1: Users and Groups
Core elements: allocation of resources
User Category:
Administrator: ID number 0
Normal User: ID number
System User: ID number 1-499
User ID =uid; Name resolution
Group Id=gid
[[email protected] vp-tools]# ID
Uid=0 (Root) gid=0 (root) groups=0 (root), 1034 (Avayavpgroup)
Group Category:
Administrators group: 0
System Group: 1-499
User group: Researcher
2: Permissions
R
W
X
R: View File contents
W: Modify File Contents
X: Start this file as a running program
R: LS to view the file name in the directory
W: can create files in this directory
X: You can CD to the directory, and LS-L displays the metadata for the catalog file.
[Email protected] vp-tools]# ls-l
Total 92
-r-xr-xr-x 1 root root 3866 Apr addserviceaccounts
3: User Management
For example:
Format--account:password:uid:gid:gecos:directory:shell
Account: Password: User id: Group ID: note Information: User home directory: User's default shell (operating system interface)
Example:craft:x:1032:1032::/cpic/craft:/bin/bash
/etc/shadow: User password and related account settings
Format: Username:passwd:lastchg:min:max:warn:inactive:expire:flag
login : Password: Most recent password change time: Change password minimum interval: password expiration: Password expiration advance warning Time: Inactivity time : Failure time
Example:craft:$6$1rmc/er7$hhd2rbgzhr3fyk0q6poshif5wnz8.eptr68006idexpejgiajgwixym8j5nkycxphaizfhp7cppjsqzkemg1n .: 16811:0:99999:7:::
/etc/group: Account information for the group
Format: group_name:passwd:GID:user_list
Example:avayavpgroup:x:1034:root,craft
/etc/gshaow: Group information, passwords and users in the group
格式:groupname:password:admin,admin,...:member,member,...
User group: User group Password: User Group manager: composition
Example:avayavpgroup:!::root,craft
4: Related commands
Useradd
-U: Specify UID
-G: Specify GID or GroupName
-G: Specify additional groups
-C ' comment content ': Comment information
-D: Specify home directory, if present, prompt
[Email protected] vp-tools]# Useradd user1
[Email protected] vp-tools]# tail-1/etc/passwd
User1:x:1036:1036::/home/user1:/bin/bash
Groupadd
-g:gid
-R: System Group
[Email protected] vp-tools]# Groupadd test
[Email protected] vp-tools]# tail-1/etc/group
test:x:1037:
This article is from the "Reminder Flower Rain" blog, please make sure to keep this source http://chenwen.blog.51cto.com/771416/1752042
Basic Linux Basics Review command Five (users and groups)