classnotes:rh124:user-man
User Management
command | options | Result |
---|---|---|
useradd | creates a new user | |
usermod | -u | used to specify the new users user id |
usermod | -d | used to specify the new users home directory |
usermod | -c | used to add a comment detail about new user |
usermod | -L | locks the user account |
usermod | -g | changes the prtimary group of a user |
usermod | -G | this changes the the secondary groups of a user |
usermod | -aG | this will append groups to the suplimentary groups |
use Lock rather than delete as it does not delete files owned by that user
Issue is if a user is deleted the home directory stays but next new user will have ownership of it
command | options | Result |
---|---|---|
userdel | deletes user keeps all files | |
userdel | -r | deletes the user and the users home directory |
YOU can find directories with no know user details with
find / --nouser --o nogroup 2>/dev/null
command | options | Result |
---|---|---|
passwd | -S | shows status of the passsword for a user |
command | options | Result |
---|---|---|
groupadd | creates a new group | |
groupadd | -r | creates a system group |
groupmod | -g | change gui for the group |
details of gui numbers is stored in /etc/login.defs under SYS_GYD
classnotes/rh124/user-man.txt · Last modified: by 127.0.0.1