Turn from: Ubuntu Create new users and increase administrator privileges
$ is an ordinary administrator, #是系统管理员, under Ubuntu, the root user does not have a password by default and therefore cannot be used (supposedly for security). If you want to use root, you have to set a password for the root user:
sudo passwd root
Then login to enter the user name root, and then enter the password on the line.
Ubuntu build users best with AddUser, although AddUser and Useradd are the same in other Linux systems, but I use useradd under Ubuntu, and did not create the same name as the user home directory.
Example: AddUser user1
This will automatically create the user home directory and create a group with the same name as the user.
[Email protected]:~# sudo adduser linuxidc
[sudo] password for XX:
Enter the password of XX user, the following information appears
Adding user "LINUXIDC" ...
Adding new Group "LINUXIDC" (1006) ...
Adding new User "LINUXIDC" (1006) to group "LINUXIDC" ...
Create home directory "/HOME/LINUXIDC" ...
Copying files from "/etc/skel" ...
Enter a new UNIX password:
Re-enter the new UNIX password:
Two times enter the initial password of LINUXIDC, the following information appears
Passwd:password updated successfully
Changing the user information for LINUXIDC
Enter the new value, or press ENTER for the default
Full Name []:
Number []:
Work Phone []:
Home Phone []:
Other []:
Full Name []: Wait for information to return all the way
Is this information correct? [y/n] Y
To this, the user adds success. If you want this user to have root privileges, execute the command:
[Email protected]:~# sudo vim/etc/sudoers
Modify the file as follows:
# User Privilege Specification
Root all= (All) all
LINUXIDC all= (All) all
Save exit, LINUXIDC user has root privileges.
For more information about Ubuntu see the Ubuntu feature page http://www.linuxidc.com/topicnews.aspx?tid=2
Ubuntu create new users and increase administrator privileges