Linux User and User Group Permissions

Source: Internet
Author: User

Each user has a unique ID number, and each group has a unique ID number.
The root user's number is 0, with the highest priority
The system user is 1-499, followed by priority
The average user is more than 500, and the maximum is more than 60 thousand,
By default, a user group with the same name and a folder with the same name under home are created. By default, this user belongs to this group, which is the main group of the user, one user can add 31 affiliated groups
User information is stored in/etc/passwd
The user password is stored in/etc/shadow.
The user group information is stored in/etc/group.

Id: this command is used to display the current user information.

[Www.bkjia.com @ localhost ~] $ Id
Uid = 500 (bkjia) gid = 500 (bkjia) groups = 500 (bkjia) context = unconfined_u: unconfined_r: unconfined_t: s0-s0: c0.c1023

Passwd is used to change the current user password.
Passwd user name to change the specified user password

Whoami view current user name
Who to view the current Login User
W. view the details of the currently logged-on user


[Root @ localhost etc] # whoami

Root

[Root @ localhost etc] # who

Bkjia tty1 2013-05-26 20:14 (: 0)

Bkjia pts/02013-05-26 (: 0.0)

Bkjia pts/12013-05-26 (192.168.200.151)

[Root @ localhost etc] # w

20:53:51 up 41 min, 3 users, load average: 0.02, 0.01, 0.02

User tty from login @ IDLE JCPU PCPU WHAT

Bkjia tty1: 0 41: 09 14.51 s 0.17 s pam: TPD-passwo

Bkjia pts/0: 0. 0 0.41 s 0.76 s gnome-terminal

Bkjia pts/119425200.151 0.00 s 0.16 s 0.23 s login -- bkjia

Useradd Add a user name


-D specifies the user directory

-S logon shell

-G: Specifies the master group.

-G: Specify the affiliated group

 


Usermod new username change Username

Usermod-L ljj prevents user ljj from logging on

-U allows users to log on

-G: Modify the user master Group

-G: Modify user group

-D. Modify the user's home directory

-U: Modify the user ID

 

 

Userdel user name delete user but keep user directory

Userdel-r user name delete user and delete user directory

 


Add a group by groupadd group name


Groupmod-n new group name modify group name

Groupmod-g new id ID modify group ID

Groupdel group name Delete Group

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.