Linux User and user group management

Source: Internet
Author: User

Tag: Font timestamp modified hash account indicates ACK command is locked

1.linux and Windows inter-pass files

Xsheel supports Linux and Windows inter-pass

1. need to install a software lrzsz on Linux Client

2. after installation, you can use the command to cross-document

sz file name ---> transfer Linux files to Windows

RZ----> Select a file for Windows

2. User-user Group management

1. File:/etc/passwd

This file records the user's user name, user ID, owning group, home directory,Shell information:

This file is separated into 7 segments by a colon: user name: password: User ID: Group ID: Comment: Home directory:Shell.

2. File:/etc/shadow

This file, each line also represents a user, is also separated by semicolons, into 9 paragraphs:

  • User name, corresponding to /etc/passwd .
  • Encrypt the password, the encryption algorithm is upgraded to SHA512 hash encryption algorithm, if the password bit is "!! "or"*"means no password, cannot log in, and its shell is /sbin/nologin. (!! Note that there is no password, or is locked, only one! is also locked. )
  • The last time the password was modified to 1970 year 1 months 1 days as standard time, every day time stamp plus 1
  • Two times the password modification interval, how many geniuses can change the password, the default is 0, that is, no limit
  • The expiration date of the password, the number of days after which the password expires, default is 99999. If set to A, that is, after the expiry of the day, you must change the password, or not login system.
  • The warning period before the password expires, if set to 6, which means that the user will be notified 6 days before expiration.
  • Account expiration grace period (relative to the 5 field). If set to 2, after expiration 2 days after the password is not changed, the user locked.
  • The life cycle of the account (which is indicated by a timestamp), the account will expire at the specified time.
  • Reserved fields, no special meaning

3. User group Management

Groupadd

-G: Specify the Group ID

-R: Adding system Groups

/etc/group (configuration file for a group)

The fields are divided by ":" : user group name, group password, group ID, other users in the group (multiple separated by commas )

Groupdel (delete user group)

Some groups are not allowed to be deleted because this group is the initial group of users

4. User Management

Add Users

Useradd

    • -U: Specify UID
    • -G: Increase the number of users who belong to a group that already exists
    • -D: Specify home directory
    • -M: Do not build home directory
    • -S: Specify Shell
    • -G: Specify additional groups

The red line is created when all the relevant properties

Delete User

Userdel

    • -R: Along with home directory also deleted

It doesn't exist after it's deleted.

Modify User

Usermod

    • -U: Modify UID
    • -G: Modify group or group ID
    • -A-G: Append additional groups
    • -D: Modify home directory,-M: with-D is a migration home directory
    • -L: Account lockout
    • -U: Account Unlocked

1. The UID is modified

Linux User and user group management

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.