Linux User and Rights management

Source: Internet
Author: User

1. User's additions and deletions change

Useradd Xiaoguo Create a user

Passed Xiaoguo Modify or add a password

Userdel Xiaoguo Delete a user

NL Shadow

NL passwd

RM-RF testuser Delete the directory where the user testuser is located


Usermod-l Xiaoguo Lock User

Usermod-u Xiaoguo Unlock user//nl/etc/shadow Remove the password in front of!

USERMOD-G root Xiaoguo Modify user groups

Groupmod-n xiaoguogroup Xiaoguo Modify Group name


ID Xiaoguo Viewing the user's basic information

Chage-l Xiaoguo Viewing the user's basic information

Chage-d 2013-02-18 Student Modify the time the user last modified


Problems you may encounter:

# #在容器里面修改用户密码的时候报错:

/usr/share/cracklib/pw_dict.pwd:no such file or directory

Pwopen:no such file or directory

Solve:

yum-y Reinstall Cracklib-dicts


2. Permissions of the user

Drwxrwxrwx

First letter: representing the file type

2nd to 4th character: represents the current user's permissions

5th to 7th character: represents the current user group permissions

8th to 10th character: Represents the permissions of other users


chmod command


A: All rights/All users

U: User

G: User Group

O: Other users


+: Plus permissions

-: Subtract Permissions

=: equals permission


Eg: add executable permissions to file file.txt

chmod a+x file.txt



0: No Permissions

1:x

2:w

3:xw

4:r

5:rx

6:rw

7:rwx


This article is from the "Zhang Xiao" blog, make sure to keep this source http://benchmarking.blog.51cto.com/12343634/1878055

Linux User and Rights 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.