What you will learn in this TP
- Manage accounts and groups
- Apply permissions, SGID and ACLs
- Delegate with sudo
Introduction #
What you will learn in this section
- Manage accounts and groups
- Apply permissions, SGID and ACLs
- Delegate with sudo
Context. A development team is joining the server. Each member needs an account, a shared project folder and the ability to restart nginx without being root, and an auditor must be able to read without modifying.
Prerequisites: a disposable Ubuntu 24.04 virtual machine (Multipass, Vagrant or cloud) with a sudo account · Estimated time: 45 min
A working team with least-privilege rights.Hands-on #
Guided steps, with their solution.
1. Create groups and accounts
Why? A group carries shared rights; never grant rights user by user.
Create thedevsgroup, usersaliceandbob(members of devs), auditorcaroland the shell-less service accountapp.2. Create the team folder
Why? The SGID bit inherits the devs group: without it, each file would take its author's personal group.
Create/srv/projetowned by group devs, mode 2770. Create a file as alice and check that bob can modify it.3. Protect a sensitive file
Why? A secret must only be readable by the account that uses it.
Create/srv/app/app.envowned byappwith mode 600, and check alice cannot read it.4. Grant read access with ACLs
Why? ACLs add a right for one person without adding them to the group or opening to everyone.
Give carol read access to/srv/projetand future files (default ACL). Check she can read but not write.5. Delegate with sudo
Why? Developers must restart nginx and read its logs, not get a root shell.
Install nginx, then create/etc/sudoers.d/devsallowing the devs group to restart nginx and read its logs. Validate the syntax and check alice's rights.6. Account policy and audit
Why? Unused accounts or unknown SUID binaries are entry points.
Enforce 90-day password expiry for alice, lock bob, list UID 0 accounts and SUID binaries.
Difficulty level : ●●○○○ (2/5)
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Microsoft Entra ID, RBAC and Azure Policy: identities, permissions and governance
Manage identities and access on Azure: Microsoft Entra ID (users, groups, MFA, conditional access...
The Bash shell and files: navigation, redirections, pipes and text processing
Master the Linux command line: paths, file handling, wildcards, redirections, pipes, searching wi...
Storage on Linux: disks, partitions, file systems and LVM
Administer Linux storage: lsblk and blkid, GPT partitioning, ext4 and XFS, mounting and /etc/fsta...
Networking on Linux: configuration, diagnosis, firewall and SSH
Configure and troubleshoot Linux networking: ip, ss, netplan and NetworkManager, DNS, layered dia...
Linux server security and hardening
Harden a Linux server: least privilege, updates, secure SSH, firewall, fail2ban, SELinux and AppA...
Bash scripts for administrators: writing robust scripts
Automate Linux administration with Bash: variables and quoting, conditions, loops, functions, exi...
Linux vs Unix: the complete guide to commands and distributions
Understand the differences between Linux and Unix, explore distributions (server, desktop, lightw...
Identities and access on OVHcloud: account, IAM, OpenStack users and keys
Secure access to OVHcloud: two-factor authentication on the account, OVHcloud IAM (identities, po...
Organizing DevOps: value streams, teams and a blameless culture
Set up a DevOps organization: value chain and value stream mapping, Team Topologies, « you build ...