Linux Common Commands (2)-User and user group management __linux
Source: Internet
Author: User
# ID # Displays the ID of the current user and user group
# who shows user information for the current login system
#su change user identity
[root@localhost/] #su chenlly
[chenlly@localhost/]
#cat/ETC/PASSWD Archives 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
1001 of which correspond to 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 login account) for general users
#cat/ETC/SHADOW Archives 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::
Store the account password, and the password is encrypted.
#cat/ETC/GROUP Archives 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 an ID number 412400
Delete a group #groupdel CDL
#groups chenlly View the group to which the user chenlly belongs
#useradd chenlly-u 3466-g 412400 (or group name) to create a user and add a group ID of 412400 and can follow the group list
#usermod-G LDC Chenliling77 modifies a user (Chenliling77 originally belonged to the CDL Group) to the LDC group
#userdel chenlly Deletes a user
#passwd chenlly Add/Modify Password
#id chenlly View the user ID and the owning group ID
Simply using the Useradd defaults will help us with several projects:
Set up a line of data related to account in/etc/passwd, including setting up Uid/gid/home directory;
In/etc/shadow, the password-related parameters of this account are filled in, but the password is not yet available;
In/etc/group, add a group name that does not have an exact name;
Create a directory under/home with the same name as the user's home directory, and the permission is 700;
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.