Ubuntu create new users and increase administrator privileges

Source: Internet
Author: User


Questions Guide:
What is the difference between 1.adduser and useradd?
2. Does that way automatically create groups, user groups, and so on?
3. How do I create a new user with administrator privileges?

$ is a normal 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
and then login with the username in root and enter the password.
Ubuntu build users best Use 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
So he automatically creates the user home directory and creates a group with the same name as the user.
[email protected]:~# sudo adduser db
[sudo] password for xx:
Enter the password for the XX user, the following message appears
adding user "db" ...
Adding new Group "DB" (1006) ...
Adding new user "db" (1006) to group "db" ...
Create home directory "/home/db" ...
Copying files from "/etc/skel" ...
Enter a new UNIX password:
re-enter the new UNIX password:
two times the initial password for the input DB, the following information appears
Passwd:password updated successfully
changing the User information for DB
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 added successfully. If you want this user to have root privileges, execute the command:
[email protected]:~# sudo vim/etc/sudoers
modifies the file as follows:
# User privilege Specification
Root all= (All) all
db all= (All) all
Save exit, DB User has root privileges.

Ubuntu creates new users and increases administrator privileges

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.