My Linux path----user and group and password management

Source: Internet
Author: User

User's creation and deletion:

    1. Useradd adding users

      -U Specify UID

      -D Specify the user's home directory

      -M does not set up a home directory, if you want to create a home directory: You can create a home directory, such as Mkdir/home/username, and then

      cp/etc/skel/.ba*/home/username, you can log in to the home directory.

      -S Custom shell

    2. Userdel Deleting a user

      -R Delete the user at the same time, along with the home directory deleted

    3. Groupadd Adding user groups

    4. Groupdel Deleting a user group

      -G Specify GID

    5. Usermod Modifying user information

      -D Modify Home directory

      -G Modify User Group

      -S Modify shell

      -G adds a user to the group

      -L Lock User

      -U Unlock User

      Note: Passwd-l is also a lock user

      Passwd-u is also unlocking the user


      Passwd-l Lock the user, in the/etc/passwd can see the locked user password in front of two!

      Usermod-l Lock the user, in/etc/passwd can see the password is locked before the user is a!.

      Unlock the user with usermod-u, unlock!!, need to be unlocked two times.

      Unlock the user with passwd-u, unlock!!, once and then OK.

    6. CHFN Username Modify User's description information

      Example: hua:x:500:500:huhu,11111,1111,1111:/home/hua:/bin/bash

Password Management:

    1. /ETC/PASSWD configuration information for users

      ①shan:②x:③501:④501:⑤:⑥/home/shan:⑦/bin/bash

      ① User Name

      ② User Password

      ③uid

      ④gid

      ⑤ description information about the user, CHFN username can be used to add descriptive information

      ⑥ User's home directory

      ⑦ User's shell environment

    2. /etc/shadow User Password configuration information

      ①shan:②$6$v4bjzenc$apntkkchk0a/1i7oakx0oykiy2. Nprxx23xlzd09omfyrwq3yx6jnxst9va.4g8.jst.jxmh8zcyvem/bl6w.:③16699:④0:⑤99999:⑥7:⑦:⑧:⑨

      ① User Name

      ② password, this is an encrypted password, $6 represents sha-512,$5 on behalf of the SHA-256,$1 representative MD5.

      ③ the last date the password was modified, expressed as the number of days from January 1, 1970.

      ④ the number of days from which a password can be changed, 0 means no limit and can be changed at any time.

      ⑤ the maximum number of days that a password must be changed

      ⑥ number of days before the account expires in advance warning

      ⑦ the number of days that a user can still be used after a password expires

      ⑧ account expiration date, expressed as the number of days from January 1, 1970.

      ⑨ reserved for future use

This article is from the "My Linux Road" blog, so be sure to keep this source http://8641765.blog.51cto.com/8631765/1696672

My Linux path----user and group and password 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.