Linux Required Skills - detailed user and authority
/etc/passwd File
Account:password:UID:GID:GECOS:directory:shell
login name: password dot character: Uid:gid: Comment Information: Home directory: User's default shell
users can join more than one group:
Basic Group
additional groups, additional groups
/etc/group File:
Group name: group Password locator: GID: comma-delimited list of users belonging to this group (as an additional group)
Useradd Command:
-uuid
-ggid: the base group to which it belongs
-ggid: the attached group to which it belongs
-C ' COMMENT ' annotation information
-d/path/to/somewhere: If this directory exists beforehand, there will be a warning message
-sshell:shell must be a SHELL that exists in the/etc/shells file
-m force user to create home directory
-M does not create home directories for users
-R Create system user
Groupadd Command
-ggid: Specify GID
-R: System Group
passwd
Ordinary users can only modify their own password
Administrator:
Passwd[username]
Password Complexity policy:
10^5 62^5 110^5
numbers, lowercase, uppercase, and special characters at least three classes
Minimum Length 5 bits
don't use easy-to-guess passwords
modify regularly and do not use passwords that have been used recently
encryption Method ;
Symmetric encryption: Encryption and decryption use the same key:
Key Distribution Difficulties
Public Key cryptography: encryption and decryption using a pair of keys
Public key: Public
private key: Confidential
CA: Certification Scheme Agency
Bob Alice
PKI:
One-way encryption: Unique signatures for extracting data
1, fixed-length output:
2, non-reversible:
3. Avalanche effect
md5:128 bits
sha1:160 bits
Bob--> data, Fingerprint--> data,
Digital signatures
passwd
--stdin
-l:lock
-u:unlock
/etc/shadow file Format
User name: encrypted password: Last password change: password minimum Age: Password maximum age: Password Expiration warning interval: password inactivity period: Account expiration: Reserved area
#man5 Shadow
Userdel:
Userdel[options] USERNAME
-r: delete users and their home directories together
Groupdel:
Groupdelgrpname
Usermod:
Usermod[options] USERNAME
-uuid
-ggid Modifying a user's base group
-G GID,...: Modify additional groups for the user , which is modified by using with- A to append the additional group
-C COMMENT:
-d/path/to/somewhere: Modifying the location of the home directory using the-m option ensures that the home directory is created and the user's original files are moved to the new home directory
-S SHELL:
-L login_name: Modify user name
-L Lock user
-u Unlock user
Chshusername
Chfnusername
Chage
Chage[option] USERNAME
To view user information:
Id USERNAME
-G
-G
-N
-U
W.H.O.
WhoAmI
Finger
To switch users:
Su:switch User
su [option] USERNAME
This article is from the "View hardware under Linux" blog, so be sure to keep this source http://4285797.blog.51cto.com/4275797/1619818
Linux Essential Skills-User and permissions