3.4 usermod Command
Change user Properties Usermod,
Change uid, command is #usermod-u number;
Change GID, command for #usermod-g number;
change The user home directory, the command is #usermod-d number;
change The user shell, the command is #usermod-s number;
Set the user expansion group, the command is #USERADD-G Group name ", group name";
View aming user Uid,gid, expansion group, #id aming;
Lock user cannot use, command for #usermod-l aming;
Unlock user, command for #usermod-u aming;
3.5 User Password Management
Modify the user password, the command is #passwd user name;
View user Password profile, command for the first 10 lines #head/etc/shadow or 10 lines #tail/etc/shadow;
Lock user cannot use, command is #passwd-l user name; password profile password bit plus two exclamation mark;
Modify the user password, clear text display password, command for #passwd--stdin User5;
Modify user password,#echo "111222" |passwd--stdin user5;
#echo-E implements some special usages, \ n newline character, \ t is tab, command is #echo-e "123\nsss";
Modify the user password, a command to enter the password two times, the command for #echo "1231111\n1231111" |passwd User3;
3.6 mkpasswd Command
Randomly generate a string as a password, command mkpasswd,make password;
installation Command MKPASSWD package #yum install-y expect;
Use method, command for #mkpasswd;
-l Specifies the length, the command is #mkpasswd-l number;
-S special symbol number, command for #mkpasswd-s number;
Linux Study notes second lesson of the third week (February 6)