Hands-on guide series

Users and Permissions on Linux: A Hands-On Guide

A nine-part, hands-on guide to Linux users, groups and file permissions: ownership, chmod, sudo, SSH keys, umask, ACLs and password policy. Every command run on a live Ubuntu server against a real service account.

9 parts60 min totalBy Amith Kumar

What you will build

Security is layers, not a switch. Each part closes a different category of attack, from the automated sweep that finds a brand-new server, to the day one gets in anyway. Read them in order, or jump to what you need.

  1. 1Users and GroupsLinux users and groups decide who owns every file and process. Create a service account and a team group on a live server, then read what an account holds.7 min
  2. 2Ownership: chown and chgrpLinux file ownership with chown sets which user and group a file belongs to. Change ownership on a live server and see why a service needs the right owner.7 min
  3. 3Read, Write and Execute PermissionsLinux file permissions rwx are the ten characters at the start of every ls -l line. Read them for user, group and other, and learn what execute means.6 min
  4. 4chmod: Symbolic and OctalThe chmod command Linux uses edits permission bits two ways. Add execute to a script with symbolic mode, then lock a secrets file to 640 with octal mode.7 min
  5. 5sudo and the Root AccountLinux sudo and root explained: why you never log in as root, how sudo runs one command at a time, and how group membership decides who may use it.7 min
  6. 6SSH Keys and Passwordless LoginSSH key authentication Linux servers support beats passwords. Generate a key pair, learn the private and public split, and set up passwordless login.7 min
  7. 7umask and Default PermissionsThe Linux umask default permissions rule sets the mode of every new file. See how umask subtracts bits, and tighten it so new files are not group-writable.6 min
  8. 8Access Control ListsLinux access control lists (ACL) grant one user access the owner-group-other model cannot. Add a rule with setfacl and read it back with getfacl.6 min
  9. 9Account and Password PolicySet a Linux password policy with chage: read password ageing, set a maximum age, and lock an account cleanly when someone leaves the team.7 min