Home  >  Article  >  Operation and Maintenance  >  Detailed example of how to create a user useradd command in Linux

Detailed example of how to create a user useradd command in Linux

黄舟
黄舟Original
2017-08-08 13:08:393378browse

This article uses code examples to introduce the relationship between the adduser and useradd commands and the method of using the useradd command to add users. Friends in need can refer to it

1, adduser and The relationship between the useradd command

Code example:


[root@larrywen opt]# type adduser 
adduser is /usr/sbin/adduser 
[root@larrywen opt]# type useradd 
useradd is /usr/sbin/useradd 
[root@larrywen opt]# which useradd 
/usr/sbin/useradd 
[root@larrywen opt]# which adduser 
/usr/sbin/adduser 
[root@larrywen opt]# ls -l /usr/sbin/adduser /usr/sbin/useradd 
lrwxrwxrwx. 1 root root   7 Jul 21 14:11 /usr/sbin/adduser -> useradd 
-rwxr-x---. 1 root root 97040 Feb 24 2011 /usr/sbin/useradd

2. Use useradd Command to add user


[root@larrywen /]# useradd zhink 
[root@larrywen /]# id zhink 
uid=501(zhink) gid=502(zhink) groups=502(zhink)

Summary

The above is the detailed content of Detailed example of how to create a user useradd command in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn