Users and Groups
username : x: UID:GID:GECOS:homedir:shell
/etc/shadow File contains the username (which must match /etc/passwd) and the users MD5 encrypted password (only readable by root)
/etc/group file contains the configuration for local groups in the following format
groupname :x: GID : secondary users
/etc/gshadow file contains a list of groups on the server and their MD5 encrypted passwords.
| useradd | used to add new users |
| usermod | used to modify the attributes of the user |
| groupadd | used to add new group to server |
| groupmod | used to change group attributes |
| passwd | used to create or change user passwords |
| chage | command used to create/edit password aging |
Locating files with Special Permissions/attributes
find . / -perm +4000 |lessfind root owned
find / -perm +2000 | lessget all GID/SUiD
find / -perm +1000 (sticky bit)can be (used to find 777)
Setuid Suid Set UserID is used on Unix systems for tasks that require higher privileges. Has greatest impact on executable files.
chmod u+s <file>setgid
chmod g+sor
chmod 2770 /some/directoryassigns group ownership to directories
example
Configure the users mike,chris and jamie
make these users part of the ru groupuseradd -s /sbin/nologin ru useradd chris -G ru -p ' '(grub-md5-crypt can be used to generate system passwords)
configure the directory /home/ru so that each user can read,create, and modify files.
chmod 2770 /home/ruor
chmod u+s /home/ru