Skip to content

Instantly share code, notes, and snippets.

@YordanGeorgiev
Created July 4, 2018 20:30
Show Gist options
  • Save YordanGeorgiev/453258660f99fed24973ec39478fd4da to your computer and use it in GitHub Desktop.
Save YordanGeorgiev/453258660f99fed24973ec39478fd4da to your computer and use it in GitHub Desktop.
[how-to edit a linux user] how-to edit a linux user #linux #user
# modify a user
usermod -a -G $group $user
# change the password for the specified user (own password)
passwd $user
#how-to forces to change password when logging in for the first time
passwd -f login
#change user pass to expire never
chage -I -1 -m 0 -M 99999 -E -1 $user
# and check results
chage -l $user
#Ei should not return anything !!!
passwd -s -a | grep NP (=No Password)
#delete an user
userdel $user
#administer the /etc/group file
gpasswd:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment