Useradd, adduser, userdel, and default parameter settings for creating users

Source: Internet
Author: User

1. When useradd is used, if no Parameter options are added later, for example: # The user created by sudo useradd test is the defaultUser. No home directory, no password, no System Shell. Add a parameter if you do not want to see "NONE". useradd-M Username

2. When adduser is used, the user creation process is more like a human-machine conversation. The system will prompt you to enter various information and then help you create new users based on the information.

In summary, in Ubuntu, adduser is more suitable for beginners, because you do not need to remember the cumbersome Parameter options, as long as you follow the system prompts to proceed step by step, the disadvantage is that the entire creation process is complicated and long. useradd is suitable for users with some high-level experience. It is very convenient to create a line of commands and parameters.

The following describes how to use The userdel user name without adding parameters. In this way, you can only delete accounts, but not user-related documents. If you want to delete user-related documents, userdel-r user name

3. The new user's shell may not be desired. Use CHSH-s [Shell Name]

Modify and then log on again to use the new shell.

Modify the default parameters of the created user:

The relevant parameters are in/Etc/login. defsAnd/Etc/default/useradd files.

Note: Modify the default shell inModified in/etc/default/useradd.

The default home directory is copied by/etc/skel.

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.