User Management
Useradd Creating a user
Options:
-U UID
-G GID
-D Home Directory, the average user has the highest permissions in the home directory, by default in the operating system's//directory.
-S login after user-enabled shell, graphical interface and command line.
[Email protected] zyj]# Useradd SL//default Create home directory and group ID, username ID and login Shell[[Email protected] zyj]# CD/Home[[email protected] home]#lshello.txt SL x zyj[[email protected] sl]# more/etc/passwdroot:x:0:0: root:/root:/bin/bashbin:x:1:1: bin:/bin:/sbin/nologindaemon:x:2:2:d aemon:/sbin:/sbin/nologinadm:x:3:4: adm:/var/adm:/sbin/nologinsl:x: 501:501::/home/sl:/bin/bash
Userdel: Deleting users
more/etc/passwdroot:x:0:0: root:/root:/bin/bashbin:x: 1:1: bin:/bin:/sbin/nologindaemon:x:2:2:d aemon:/sbin:/sbin/ NOLOGINADM:X:3:4: adm:/var/adm:/sbin/nologinzyj:x: £ python_full:/home/zyj:/bin/bash
passwd: Set a password for all users and re-execute the equivalent of a password change.
passwd // change the root password directly without adding users for passwd// Modify password for user Zyj for
[email protected] ~]# echo "123123" | passwd-- stdin Zyj //Set the password for user Zyj once . passwd: All authentication tokens updated successfully.
Usermod: Modify user account properties
-U UID System assigns 500 user ID to user id,root after 0
-G GID
-C
-d,-m
-S
-L
-L: Lock account
-U: Unlock Account
Chsh: Modify the user's default shell, set the user cannot log in, need to use this command. Modify/bin/bash to/sbin/nologin
[email protected] home]# chsh sl changing Shell forSL. New Shell [ /bin/bash]:/sbin/ nologinShell changed. [Email protected] home]# [[email protected] home]# More/etc/passwdroot:x:0:0: root:/root:/bin/bashtcpdump:x: the: the::/:/sbin/nologinzyj:x: -: -: python_full:/home/zyj:/bin/bashsl:x:501:501::/home/sl:/sbin/Nologin[[email protected] home]#
Finger: View user account information
CHFN: Modifying annotation information
for 1231231222222
ID: View User ID information
ID zyjuid=zyj gid=Groups=ID sluid =501(SL) gid=501Groups=501(SL)
Chage: Modify the user password information, the user password default period of 99,999 days.
-D: Last modification time
-E: Expiration time
-L: Inactivity time
-M: Minimum period of use
-M: Maximum lifespan
-W: Warning time
[Email protected] home]# More /etc/ Shadow //view password default parameter root:$1$swlT 1$4HBBALVXQX4TE2W3SR9WW1:17635:0:99999:7::: Bin:*:17246:0:99999:7: ::d Aemon:*:17246:0:99999:7::: adm:*:17246:0:99999:7:::LP:*:17246:0:99999:7:::Sync:*:17246:0:99999:7:: : Shutdown:*:17246:0:99999:7:: : Halt:*:17246:0:99999:7:: : Mail:*:17246:0:99999:7:: : UUCP:*:17246:0:99999:7:: : operator:*:17246:0:99999:7:: : Games:*:17246:0:99999:7:: : Gopher:*:17246:0:99999:7:::FTP:*:17246:0:99999:7:: : Nobody:*:17246:0:99999:7: ::d bus:!!:17635::::: : usbmuxd:!!:17635::::: : Rtkit:!!:17635::::: : Avahi-autoipd:!!:17635::::: : VCSA:!!:17635::::: : ABRT:!!:17635::::: : Haldaemon:!!:17635::::: : NTP:!!:17635::::: : Apache:!!:17635::::: : Saslauth:!!:17635:::: ::p ostfix:!!:17635::::: : GDM:!!:17635:::: ::p ulse:!!:17635::::: : sshd:!!:17635::::: : tcpdump:!!:17635::::: : zyj:$1$B 9mfalrm$atlvuiseu92vf9uibg11z.:17646:0:99999:7:: : SL:!!:17646:0:99999:7:::
Group Management
Groupadd
Groupdel
Groupmod
gpasswd
Rights Management
Chown
Chgrp
chmod
Umask
Linux Rights Management