Go: Ubuntu Add user adduser, and give sudo permission

Source: Internet
Author: User

Ubuntu Add user adduser, and give sudo permission

How do I create a new Ubuntu user?

First open the terminal, enter: sudo adduser username
Adding user "username" ...

Adding new Group "username" (1001) ...

Adding new user "username" (1001) to group "username" ...

Create home directory "/home/username" ...

Copying files from "/etc, Skel" ...

Enter a new UNIX password: (note here, instead of entering your current user's password, enter the password you want to create a new user)

Re-enter the new UNIX password: (You can lose again)

passwd: Password has been successfully updated

Changing the user information for username
Enter the new value, or press ENTER for the default
Full name []: SD4 (Enter the name of the new user)
Number []:
Work Phone []:
Home Phone []:
Other []:
Is this information correct? [y/n] Y

At this point, the new user has been added successfully, at this time we can play ls/home view, if the display username yangming, the side on behalf of the user creation success.
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
DB all= (All) all
Save exit, the DB user has root privileges.

How do I delete Ubuntu users?

Ubuntu Delete users are also operating under the terminal, it is important to note that if you want to delete the user is currently logged in, is deleted, you must log off the current user to switch to another user to delete. For example, just now I set up a new user for yangming user, for example I now use User yangming landed on the desktop, at this time if I want to delete yang this user, is deleted. The correct way to do this is, I write off Yang, and then use root to log on to the desktop, and then delete yangming.

Deleting Ubuntu user commands is easier to remember: sudo userdel username, for example I want to delete yangming, then enter: sudo userdel yangming, after deletion succeeds, the system does not have any prompts.

Go: Ubuntu Add user adduser, and give sudo permission

Related Article

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.