Ubuntu12.04 create and delete users

Source: Internet
Author: User
Ubuntu has been used for a long time by using the account used to install the system. I have never added it myself. I want to add an account today. I searched the internet and saw this article htt.

Ubuntu, which has been used for a long time, uses the account used to install the system. I have never added it myself. I want to add an account today. I searched the internet and found this article.

Http://wiki.ubuntu.org.cn/the newly created user is added to the management group.

Start in recovery mode and enter command line mode. the prompt must be #

1. enter the user management command to create a user (take test as an example ):

# Useradd test

Modify the password of the test User:

# Passwd test

2. add a new user to the management group:
# Gpasswd-a test admin

3. create a directory for the test User:
# Cd/home

# Mkdir test

# Chown test/home/test

4. restart,
# Reboot

Then use test to log on,

After logging on, click "system-system management-users and groups", select your users, click "properties" on the right, and check the required permissions;

Use the root account to add the account according to the instructions. after the account is created, it is found that the account can be logged on, but some shell configurations are not available, but some shell configurations are not available. continue to find information. Find this article and explain it in detail.

Http://blog.csdn.net/yuzaipiaofei/article/details/6590358

Delete the test account created earlier.

Under the root user: userdel-r newuser

Under normal users: sudo userdel-r newuser

Create a new account named test

# Useradd-r-m-s/bin/bashtest

# Cd test

# Ls-

... Bash_logout. bashrc examples. desktop. profile

At this step, the account is created. Another problem is that the account has no permission to execute sudo. perform the following steps to add the account:

1. enter the superuser mode. That is, enter "su-". The system will ask you to enter the superuser password and enter the password to enter the superuser mode.

2. add the write permission for the file. That is, enter the command "chmodu + w/etc/sudoers ".

3. edit the/etc/sudoers file. That is, enter the command "vim/etc/sudoers", enter "I" to enter the editing mode, and find this line: "root ALL = (ALL) ALL "add" xxxALL = (ALL) ALL "(here xxx is your user name), and save it (that is, press Esc first, and then enter ": wq ") quit

4. revoke the write permission of a file. That is, enter the command "chmodu-w/etc/sudoers ".

At this point, a complete account is basically created.

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.