Add and delete user commands in Debian Linux

Source: Internet
Author: User
In Linux, user management is often required. Of course, this includes adding, deleting, and modifying user passwords. 1. the adduser format is adduserusername. note: this command automatically creates users, user groups, and user home directories. you must enter the user password. While useradd creates only one user.

In Linux, user management is often required. Of course, this includes adding, deleting, and modifying user passwords.

1. adduser

Format: adduser username

Note: this command automatically creates the user, user group, and user home directory, and requires you to enter the user password. While useradd creates only one user, nothing else will be processed. Note that this command requires the root user group to grant specific execution permissions.

Instance:

Development:/home # adduser tx
Adding user 'tx '...
Adding new group 'tx '(1008 )...
Adding new user 'tx '(1008) with group 'tx '...
Creating home directory '/home/tx '...
Copying files from '/etc/skel '...
Enter a new UNIX password:
Re-enter the new UNIX password:
Passwd: The password is successfully updated.
Changing user information of tx
Enter a new value or press the Enter key to use the default full name []: room number []: work phone number []: home phone number []: other []:
Is the information correct? [Y/n] y
Development:/home #

2. delete user userdel

Format: userdel-r username

Note: this command will directly delete all user information, including user information and user home directories.

Instance:

Development:/home # userdel-r tx
Development:/home # su tx
Unknown id: tx

3. change the user password passwd

Format: passwd username

Note: this command directly modifies the password of a user.

Instance:

Development:/home # passwd root
Enter a new UNIX password:
Re-enter the new UNIX password:
Passwd: The password is successfully updated.

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.