I have written an article about the commands "adduser" and "useradd" for creating a new user in Ubuntu10.04 ". URL: Workshop. At that time, I also spoke about the disorderly online articles. Now, after my own experiments, I found that
I have written an article about the commands "adduser" and "useradd" for creating a new user in Ubuntu 10.04 ". Web: http://www.linuxidc.com/Linux/2012-06/63043.htm
In fact, many articles on the Internet said that these two commands actually have the same effect, but I found that they are not the same when I tried them on Ubuntu 10.04. At that time, I also spoke about the disorderly online articles. Now, after my own experiments, I found that the two commands in different versions of Linux are not exactly the same. I compared CentOS with Ubuntu.
First, let's take a look at the CentOS directory and run the command
[Root @ localhost sbin] # ll | grep useradd
The following result is displayed:
Observe the first and third items in the above results. We can find that the original adduser is linked to useradd. Therefore, in Centos, useradd and adduser have the same functions. After a user is created, a new user record is added to the/etc/passwd file, and the home directory of the new user is created under the/home directory, copy the files in the/etc/skel directory to the directory.
Note: New users created in this method cannot log on to the system before setting the password, you need to use the "passwd User Name" method under the root permission to set a password for the specified user. You can log on to the system with the user name and password next time.
Next, let's take a look at the ubuntu system, first go to the/usr/sbin directory and use the command
[Root @ localhost sbin] # ll | grep useradd
The following result is displayed: