Ubuntu User Management

Source: Internet
Author: User

This article mainly introduces the user management of Ubuntu, including the establishment and deletion of users, user authorization, etc.


================== create user and authorize ==================

sudo adduser XXX will add an account in the home directory sudo useradd xxx is simply adding users and will not add accounts in the home directory

1.1. Add user, configure password

sudo AddUser AAAA sudo passwd AAAA

1.2. Modify the user group to belong to the root group (wheel)

Usermod-g Root AAAA

1.3. Give root privileges
Modify the/etc/sudoers file, find the following line, remove the previous comment (#)

sudo vi /etc/sudoers
inch group wheel to run all commands%wheel all= (All) all
AAAA all= (All) all

You can also add a row under ROOT to authorize the specified user

After the modification, you can log in with the new user account and then use the command Su-to get root permission to operate.

1.4. Edit configuration file Configuration root login

sudo gedit/etc/ssh/sshd_config
# comment out Permitrootlogin without-password# enable Permitrootlogin Yes
Service sshd Restart

================== Delete User ===================
Under the root User:

Userdel-r AAAA

Under the ordinary User:

sudo userdel-r aaaa

The user needs to be completely removed, plus the-r option to remove the user's host directory and the Mail directory while deleting the user.

==================== Expansion: ====================
The normal user cannot use the TAB key, the upper and lower key, the command line does not display the current path?
Because the default Ubuntu created by the normal account, the default shell is/bin/sh, and this does not support tab key, so the "designated user" account of the shell changed to/bin/bash.
1. View the current shell:

Echo $SHELL/bin/sh

2. Modify the Shell to/bin/bash:

Usermod-s/bin/bash AAAA

Finished, hehe hehe

Ubuntu User Management

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.