Liunx basic commands (repeated descriptions of user management and difficulties)

Source: Internet
Author: User

Hello everyone, this time I spoke about the content of the user group, but I divided the content into two parts, each of which was labeled, because this part was really messy when I was studying it, so I enhanced his record. I hope you can practice more. Come on.


Create a user:

Useraddd wo


Delete all user content:

Userdel-r wo


Locked account:

Usermod-L wo

Unlock account: (xiao2

Usermod-U wo


Lock User Password

Passwd-l

Unlock User Password

Passwd-u

View User Password status

Passwd-S


Modify user uid

Usermod-u 500 wo

Modify user gid

Usermod-g 500 wo

Recursively modify all user IDs

Usermod-R 500 wo


Modify the user owner:

Usermod-l old name

Modify the user's own group and modify the user's original additional group name)

Groupmod-n old name


Add an additional group a, B, and c under user wo.

Usermod-G a, B, c wo

Usermod-a, B, c wo


Delete multiple additional groups in a user:


Gpasswd-d user group [root @ 0425 ~] # Gpasswd-d a, B, c wo

The user "a, B, c" is being deleted from the "wo" group.

Gpasswd: Unknown member a, B, c


One user adds multiple additional groups:

Usermod-G group, group, the group user overwrites the original additional group except the main group ,)

Usermod-a-G group, group, group users add new additional groups

X'

Delete group:

[Root @ 0425 ~] # Groupdel c


Add multiple users to a group:

Gpasswd-M User, user group


Delete multiple users in a group:

[Root @ 0425 ~] # Gpasswd-d wo zu


Change the environment variable to display byebye when the user logs out !!!! ----- How to set this?



------------------------------------------------------------

Modify file permissions:

Chmod u g o xu

Modify the object owner

Chown wo xu

Modify the object owner group :-

Chown. wo xu


This article is from the "history_xcy" blog, please be sure to keep this http://historys.blog.51cto.com/7903899/1296619

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.