Get administrator permissions In debian and add and delete various types of users

Source: Internet
Author: User
Tags email account
Get administrator permissions In debian and add and delete various types of users-Linux Release Technology-Debian information. The following is a detailed description. # Su
Password:
You can.
In ubuntu:
# Sudo
Password

Add a user with the same permissions as root to linux.
# Useradd-u 0-o-g 0 username use the-o parameter to allow users with the same id to be created

Add common user commands:
Adduser abc

Passwd abc

Exit

Log On with abc

/Etc/passwd saves user information

Create USER commands in LINUX
Useradd-g test-d/home/test1-s/etc/bash-m test1
Note: SHELL used by-g group-d home directory-s
Delete USER commands
Userdel-r test1
Create PASSWORD command
Passwd

1. Add a user

The command for adding a user is useradd. Suppose we add a user named testuser, set its logon Shell, and set its other attributes:

Useradd Cs/bin/bash CG thiz Cd/home/testuser

Passwd testuser

For more information about useradd, see man useradd. Here, the-s parameter is used to specify the user's startup Shell. If you do not want to authorize the user's Shell, add/dev/null and/usr/bin/passwd to/etc/Shells, specify the Shell as/dev/null or/usr/bin/passwd. The first case is that a user is not allowed to log on at all (for example, the user is an email account and only allows sending and receiving emails). The second case is that the user is allowed to log on only and change the password. -G is used to specify that a user belongs to the added testuser user group and also belongs to the thiz user group. -D is used to specify the location of the user's main directory. It is specified as the default location/home/testuser (you can also choose not to specify this location./home/testuser is created by default, and direct the user's main directory to this directory ). After adding a user, you need to use the passwd command to set a password for the user.

To modify the attributes of added users, run the usermod command or get more information in man usermod.

Use Webmin to enter the user management module of the system information, as shown in Figure 8-2.

2. delete a user

You can run the userdel command to delete a user, depending on the software installed in the system.

# Userdel testuser

However, deleting a user does not delete the home directory created for the user. This is because the directory may still store useful files, if you are sure that the user's main directory does not have the required files, you need to manually delete the user's main directory, for example:

# Rm Crf/home/testuser

To delete a user in Webmin, select the user you want to delete and click the delete button at the bottom.

3. Change the password

To change the password, run the following command:

# Passwd username

You can modify the user password. Of course, the user password modification function is provided in Webmin. You only need to select the Change Passwords module in the system and enter the Change Password module.
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.