[{ALLOW view All}] [{ALLOW edit Authenticated}] Links * [http://freshtutorial.com/add-users-groups-change-password-linux-terminal/] * [http://webtools.live2support.com/linux/passwd.php] ! Maintain Do not edit passwd and groups directly {{{ groups markus # show groups of a user id markus # show groups of user with ids sudo usermod -g markus markus # change primary group of an user sudo usermod -aG groupname markus # add user to a group sudo usermod -rG groupname markus # remove user from a group sudo gpasswd -d markus groupname # remove group of a auser }}} ! /etc/passwd * contains all Users * Benutzer:Passwort:User-ID:Group-ID:Kommentar:home-Verzeichnis:Shell * there is a shadow file under /etc/shadow ! /etc/group * contains all groups Editing the files above is not suggested, use following commands to maintain users and groups {{{ who who -a users w cat /etc/passwd cat /etc/group usermod -G deploy,root root usermod -a -G groupname username usermod -d /path/to/new/homedir/ username useradd chown -R <user> *|change owner for whole subfolder chmod <rights> <file>|x=1 w=2 r=4, oga = owner group all chgrp adduser username passwd username addgroup groupname userdel username deluser user group groupdel groupname vipw -s : Edit /etc/passwd file vigr -s : Edit /etc/group file }}} |chage|change user password expiry information {{{ chage -l username chage -E 03/31/2014 -m 5 -M 90 -I 30 -W 14 username }}} Lock/Unlock user |passwd -l <username>|Lock user |passwd -u <username>|Unlock user |passwd -a -S|Show list List columns: |1|login name\\ |2|locked password (L) / has no password (NP) usable password (P).\\ |3|date of the last password change\\ |4-7|password: minimum age, maximum age, warning period, inactivity period in days\\