# ID # Displays the ID of the current user and user group
# WHO # Displays user information currently logged into the system
#su change user identity
[Email protected]/] #su chenlly
[[Email protected]/]
#cat/ETC/PASSWD File Structure
Root:x:0:0:root:/root:/bin/bash
chenlly:x:1000:1000:chenlly,,,:/home/chenlly:/bin/bash
Sshd:x:114:65534::/var/run/sshd:/usr/sbin/nologin
Oracle:x:1001:1001::/home/oracle:/bin/bash
Where 1001 corresponds to the UID and GID
Uid:id Range
When the UID is 0 o'clock, this account is the system administrator
1~499 SYSTEM Account
500~65535 (can log in account) for ordinary users
#cat/etc/shadow File Structure
Chenlly:$6$vct89b4h$4zdiu2.uwvfrcloe6uchp7avkscrgk2bcmq. Bdgmniujwof0ida1qflpwsptse2snnlnfihd5bl0ifdjtqtk/:15595:0:99999:7:::
Sshd:*:15595:0:99999:7:::
oracle:$6$6l0houuo$lczjf8rah1eiy2fw8v4610vwfv7awpdqblh6x1uqcfwajpxhtoodl1mzgc0pwhpzlrlu4pszjyj0hw.4xkolq/ : 15595:0:99999:7:::
The account password is stored and the password is encrypted.
#cat/etc/group File Structure
root:x:0:
chenlly:x:1000:
1. Group name 2. Group Password 3.GID:
#groupadd-G 412400 CDL creates a group CDL and assigns it ID number 412400
#groupdel CDL Delete a group
#groups chenlly View the group that the user chenlly belongs to
#useradd chenlly-u 3466-g 412400 (or group name) create a user and join the group ID of 412400 and can follow the group list
#usermod-G LDC chenliling77 Modify a user (Chenliling77 originally belonged to the CDL Group) to the LDC group
#userdel chenlly Delete a user
#passwd chenlly Add/Change Password
#id chenlly View User ID and owning group ID
Simply using the Useradd default value will help us with several projects:
Establish a line of data related to the account in/etc/passwd, including the establishment of Uid/gid/home directory, etc.;
In/etc/shadow, the password related parameters of this account are filled in, but there is no password;
Add a name to the/etc/group that is not an account.
Create a directory with the same name as the account under/home, with a permission of 700;
Linux common Commands (2)-User and user group management