User account and group account management
Here are some of the collation and instance configuration between the user account and the group account.
The user and group accounts in the Linux system are divided into the following points:
Superuser: Theroot user is the Linux default Superuser with the equivalent of the Windows system the role of administrator.
Normal User: The account of the ordinary user needs to be created by root or other administrator user.
Program User: Used to add Some specific low-privileged users in a Linux system. (These users are only used for maintenance or for a program to function properly)
Group account
Basic Group (Private group): Each account has its own group.
Additional groups (public groups): In the same group as other users.
Both the user and the group account haveIDnumber, just likeWindowsthe administrator user in the systemIDis a,and the average user is from +the beginning. andLinuxuser accounts in the system.IDcalledUID, while group accountsIDcalledGID.
root are 0 id all from the 1~499 id all from Span style= "font-family: ' Times New Roman ';" >500~60000
There are two main profiles associated with user accounts: /ETC/PASSWD etc. basic information. 2 Span style= "font-size:14px;font-family: ' The song Body '; Color:rgb (255,0,0);" >/etc/shadow store user password effective time etc information.
Why separate the user password information from the user?
If you put it in the /etc/passwd directory, criminals can get strings for brute force, so it's not safe, so there 's /etc/shadow . The creation of a directory is why it is called a shadow file. And the directory is readable only by the root user, but it is also the content in a file that is not allowed to be changed directly.
In the view information shown, you will see that each message is separated by a colon. In fact, each paragraph represents a meaning
First paragraph: User account name
The second paragraph: exclamation mark for the lock user, blank means no password to login.
Third paragraph: The last time the password was modified. Count from January 1, 1970
Fourth: After the password has been modified, it must pass this number of days before the password can be changed again. The default value is 0, and no limit is made.
Fifth paragraph: The opposite of the fourth paragraph. The default value is 9999, which means no restrictions are made.
The sixth paragraph: how many days in advance, warning the user password expires, the default seven days.
The seventh paragraph: the number of days after the password expires in the static use of this user.
Eighth: The expiry date of the account is calculated from January 1, 1970. The default is null, which means the account is always available.
Nineth: Reserved fields are not used at this time.
650) this.width=650; "title=" Picture 1.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M01/6C/09/ Wkiol1u-ogzamfcqaadoq7fyaak655.jpg "alt=" Wkiol1u-ogzamfcqaadoq7fyaak655.jpg "/>
650) this.width=650; "title=" Picture 2.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M02/6C/0D/ Wkiom1u-nwjzveozaafpseqvipg905.jpg "alt=" Wkiom1u-nwjzveozaafpseqvipg905.jpg "/>
Add Delete and modify user accounts
New user and user password settings
650) this.width=650; "title=" Picture 3.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M01/6C/0D/ Wkiom1u-nwitjpsraadi9aup80g588.jpg "alt=" wkiom1u-nwitjpsraadi9aup80g588.jpg "/> 650" this.width=650; " title= "Picture 4.png" style= "Float:none;" src= "http://s3.51cto.com/wyfs02/M02/6C/09/wKioL1U-OG2gV72vAAFD19xfoTk779.jpg "alt=" wkiol1u-og2gv72vaafd19xfotk779.jpg "/>
passwd Command:
-L : Lock user
-U : Unlocking the user
-D : Clear user Password
-S : View user status
650) this.width=650; "title=" Picture 5.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M02/6C/0D/ Wkiom1u-nwiqr8eraahvd3zw8ji994.jpg "alt=" Wkiom1u-nwiqr8eraahvd3zw8ji994.jpg "/>
Usermod Command:
-U : Modify user UID number
-D : Modify the user host directory
-E : Modify user Expiration date
-G : Modify user-attached group name
-G : Modify user base Group name
-M: Do not create initialization directory for user
-S : Specify user account login name
-L : Change account login name
-L : Lock user
- u : Unlocking the user 650) this.width=650; "title=" Picture 6.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/6C/09/ Wkiol1u-og3ikukwaadnkreqrdw357.jpg "alt=" wkiol1u-og3ikukwaadnkreqrdw357.jpg "/>
useradd command:
-U : Specify user UID
-D : Specify user-owned home directory location
-E : Specify user Expiration Time
-G : Specify user base Group name
-G : Specify user-attached group name
-M : Do not establish the host directory
-S : Specify user login Shell
650) this.width=650; "title=" Picture 7.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/6C/0D/ Wkiom1u-nwisandeaahhx-yoemw799.jpg "alt=" Wkiom1u-nwisandeaahhx-yoemw799.jpg "/>
650) this.width=650; "title=" Picture 8.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M01/6C/09/ Wkiol1u-og3hoqqjaaelao75arm918.jpg "alt=" Wkiol1u-og3hoqqjaaelao75arm918.jpg "/>
650) this.width=650; "title=" Picture 9.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M01/6C/0D/ Wkiom1u-n43sblefaak7pue8ady398.jpg "alt=" Wkiom1u-n43sblefaak7pue8ady398.jpg "/>
Userdel-r : Delete with host directory
Initial configuration file for user account
" . Bash_logout " execute when logging out
" . Bash_profile " user directories are executed every time they log in
" . BASHRC " Execute every time you enter a new bash environment
The alias alias mechanism can be simplified for use with longer command lines . Can be understood as shortcut keys.
Enter VI/ROOT/.BASHRC to set aliases (add executable statements that users set themselves)
Enter VI/ETC/BASHRC to set aliases (all users add command programs that run automatically after logging in)
650) this.width=650; "title=" Picture 10.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M02/6C/09/ Wkiol1u-opkrjkswaabatl1antc384.jpg "alt=" Wkiol1u-opkrjkswaabatl1antc384.jpg "/>
650) this.width=650; "title=" Picture 11.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M02/6C/0D/ Wkiom1u-n42dmnaraab1b2pby-o587.jpg "alt=" Wkiom1u-n42dmnaraab1b2pby-o587.jpg "/>
650) this.width=650; "title=" Picture 12.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/6C/09/ Wkiol1u-oplg7uosaafshpbzqs8327.jpg "alt=" Wkiol1u-oplg7uosaafshpbzqs8327.jpg "/>
Group account Management
Add group account:
[[email protected]/] #groupadd Zhangsan
Add settings to delete Group members:
-A: Add users to the group.
-D: Delete the users in the group.
-M: Specifies all user members in the group account. User members are separated by commas. 650) this.width=650; "title=" Picture 13.png "style=" Float:none; "src=" Http://s3.51cto.com/wyfs02/M00/6C/0D /wkiom1u-n47j7v6daafmqqnasd0039.jpg "alt=" wkiom1u-n47j7v6daafmqqnasd0039.jpg "/>
Delete group account with Groupdel Zhangsan can be.
Query the login properties of the user account with finger.
Mount the finger package first.
650) this.width=650; "title=" Picture 14.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M01/6C/09/ Wkiol1u-opkggvwtaabvwn8uml4405.jpg "alt=" Wkiol1u-opkggvwtaabvwn8uml4405.jpg "/>
650) this.width=650; "title=" Picture 15.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M01/6C/0D/ Wkiom1u-n46bbpaiaahp900bpkg007.jpg "alt=" wkiom1u-n46bbpaiaahp900bpkg007.jpg "/>650) this.width=650;" Title= " Picture 16.png "style=" Float:none; "src=" Http://s3.51cto.com/wyfs02/M02/6C/09/wKioL1U-OPOhChQmAAHLiz5igHI838.jpg "alt=" Wkiol1u-opohchqmaahliz5ighi838.jpg "/>
Query the current host's login status with W . Lists the name of the login account, the terminal, login time, source, and so on.
650) this.width=650; "title=" Picture 17.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M02/6C/0D/ Wkiom1u-n47wlfewaacwamt1ap4780.jpg "alt=" Wkiom1u-n47wlfewaacwamt1ap4780.jpg "/>
Query the identity IDof the user account.
650) this.width=650; "title=" Picture 18.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/6C/09/ Wkiol1u-oppwfjiyaacmrj4aoc8464.jpg "alt=" Wkiol1u-oppwfjiyaacmrj4aoc8464.jpg "/>
This article is from the "Routing" blog, so be sure to keep this source http://9863378.blog.51cto.com/9853378/1639478
Example and explanation of user and group account management of "Linux system"