Linux Note II: System User Management

Source: Internet
Author: User

User Category:

Administrators group:

Normal Group:

System Group:

General Group

User Group Category:

Private group: Create a user, create a group with the same name by default if the owning group is not specified

Basic group: Default group for users

Additional groups, additional groups: Default groups for other groups

User:

/etc/passwd

Account

passwd

Uid:

Gid:

Comment

HOME DIR:

SHELL:


/etc/shadow

Account

Encrypted password:


User management:

useradd [option] USERNAME

-U UID

-G GID (Basic Group)

-G GID, .... (Additional groups)

-C Comment Information

-D Home Directory

-S SHELL

-m-k

-M do not create home directory

-R Add a system user

/etc/login.defs

Userdel [option] USERNAME

-R: Colleague deletes user's home directory


ID: View user's account attribute information


Usermod

-L: Modify login Name

-L: Lock account

-U: Unlock Account

CHSH: Modifying the user's default shell


CHFN: Modifying annotation information


Password management

passwd [USERNAME]

--stdin standard input Read password

-L

-U

-D Delete User password


PWCK: Checking user account Integrity


Group Management:

To create a group:

Groupadd

-G: Specify GID

-R: Add a system Group

Groupmod

-g:gid

-n:grpname


Groupdel


GPASSWD: Setting a password for a group


NEWGRP: Temporary switch Group (exit exit)


Chage

-D: Most recent modification time

-E: Expiration time

-I: Inactive time

-M: Minimum period of use

-M: Maximum lifespan

-W: Warning time


Rights Management:


Chown: Change file owner (only administrators can use this command)

#chown USERNAME file, ....

-R: Modify the owner of the directory and its internal files

--reference=/path/to/somefile file,... Reference a file, set the same as the reference file

Chown username:grpname file, .... (USERNAME. GRPNAME) Change the genus Group at the same time


#chgrp GRPNAME file, ...

-R: (Recursive)

--reference=/path/to/somefile file,... Reference a file, set the same as the reference file


chmod: Modify permissions for a file

Modify the permissions of the three categories of users;

chmod MODE file, ....

-R: (Recursive)

--reference=/path/to/somefile file,... Reference a file, set the same as the reference file


This article is from "Satan Daily" blog, please make sure to keep this source http://satantiantian.blog.51cto.com/6159537/1568735

Linux Note II: System User 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.