User management and user group management

/ etc / the passwd
/ etc / Shadow
/ etc / gshadow
/ etc / Group
available man 5 passwd / shadow / gshadow / group for instructions

Simultaneously performing two commands
head -2 / etc / passwd; tail -2 / etc / passwd

groupadd -g 1100 grp1 new group and define the group number
groupdel grp1 delete group (the group users can not delete)
useradd to create the Test user, the default user group with the same name
useradd -M username create a user does not create a home directory
useradd -u specified uid
useradd -g group name is specified
userdel username delete user
userdel -r username delete a user's home directory and delete
usermod -u 1022 username modify uid
the usermod -g 1022 goupname modify gid
the usermod -d / home / username newhome
the usermod -s / sbin / nologin username modification user shell

passwd user to modify the user password
passwd -l user -L Lock user password the User the usermod
passwd -u user password to unlock the User usermod -U user

passwd --stidn user to change the password console password echo
echo "11111111" | passwd --stdin the User
echo "123456 \ n123456" | passwd the User reserved escaped double quotes

Random password generation tool
yum the install -Y Expect
the mkpasswd -l -s 0. 8

Guess you like

Origin blog.51cto.com/11017476/2435276