User Management Flashcards
useradd
- c: comments
- G: add supplementary group
- g: add primary group
- m: home directory
- s: default shell
passwd
-e: expire after use
userdel
-r: remove home directory
groups
Shows user what primary and secondary groups members of.
groupadd
Add system group
Remove with groupdel
/etc/passwd
Flat file database with info on users and system accounts.
Format is: user, password field ( x=encryption in /etc/shadow ) , uid, bid, uid info, full home path, comment for account, directory path for shell.
/etc/shadow
Similar layout to passwd. User, encrypted password, days since J1:1970 password changed, min # days password valid, days may change password, days warning, days inactive following expire, day account expires. Note: encryption can be identified within salt. $1$=MD5 $2a$=Blowfish $2y$=Blowfish $5$=SHA256 $6$=SHA512
/etc/group
UID, password status, gid , other used in.
/etc/skeleton
Contains items automatically added to new user’s home directory when account created.
/etc/default/useradd
Config file referenced by useradd when new user acct created. Includes GROUP, HOME, INACTIVE, EXPRE, SHELL, SKEL, CREATE_MAIL, SPOOL.
getent
Query database for info about user/group.
Can see: group, passwd
usermod
Modify user account settings.
- a: add
- d: home directory
- G: secondary group
- L: lock login
- s: shell file
- U: unlock login
change
List and modify aging parameters of user passwd.
- E : expire. Ex: -E 2019-01-01
- l: list account settings
- W : amount of days to expire.
groupmod
Modify attributes of existing groups
- g: set new GID
- n: set new name for group.