Linux Users, Groups, and Permissions Files ----- /etc/passwd /etc/shadow /etc/group /etc/shells /etc/skel /etc/passwd ----------- username encrypted password uid gid GECOS home directory shell /etc/shadow ----------- username encrypted password day of last password change (since Jan 1, 1970) days before password may be changed days after which password must be changed days before expiration of password to warn the user days after password expires that account is disabled day of account disabling (since Jan 1, 1970) reserved field /etc/group ---------- group name encrypted group password gid list, of, usernames Commands -------- - User/Group management adduser addgroup deluser delgroup - File ownership/permissions management chown chgrp chmod umask ls - User account editing/examination passwd chsh chfn chage finger groups id - User/Group access ssh su newgrp File Permissions ---------------- - 12 file mode bits exist - User, group, other, special - Read (ugo) - Write (ugo) - Execute (ugo) - Setuid (u) If file is a directory: Ignored If file is a file: When executed, the process belongs to the file's owner, instead of the user. - Setgid (g) If file is a directory: New files in the directory will belong to the same group as the directory. If file is a file: When executed, the process belongs to the file's group, instead of the user's group. - Stick bit (o) If file is a directory: Users can not delete files in this directory, unless they own the file, or directory. Documentation ------------- man 5 passwd man 5 shadow man 5 group man command (such as chown or chmod)