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
Users, groups, sudo and permissions on Linux
Manage Linux accounts (useradd, usermod, passwd, chage), groups, sudo and visudo, rwx and octal p...
Users, groups, NTFS permissions and SMB shares
Manage local accounts and groups, understand UAC, apply NTFS permissions with inheritance, create...
Linux administration best practices
Checklist for administering Linux servers: accounts and sudo, SSH, updates, systemd services, sto...
Grafana cross-dashboard variables: share variables across dashboards
Create your Grafana variables once and reuse them everywhere: global or folder scope, enabling, a...
Grafana administration and security: organizations, teams, RBAC, service accounts and authentication
Running Grafana in a company: organizations, teams, folders, roles and RBAC, data source permissi...
Ansible: managing security (Vault, SSH, privileges and secrets)
Securing Ansible: Ansible Vault, SSH key authentication, become and sudo, no_log, hardening the c...
Packages, systemd services, logs and scheduled tasks
Install and update software with apt and dnf, manage services with systemctl, write a systemd uni...
Dynatrace: managing permissions (IAM, groups, policies and boundaries)
Manage access in Dynatrace: the IAM model (users, groups, policies, boundaries), default policies...
Enterprise features
Grafana Enterprise features (also in paid Grafana Cloud tiers): fine-grained RBAC, data source pe...