Interview Prep/Linux/Users, groups and access control

A service account for a backup tool must exist on every server but nobody should be able to log in as it. How do you create it?

BeginnerScenarioUsers, groups and access control
Answer

Situation read → System user with no shell, no password, no home clutter.

What I'd do →

sudo useradd --system --no-create-home --shell /usr/sbin/nologin backupsvc
sudo passwd -l backupsvc
getent passwd backupsvc

Give it ownership only of what it needs, for example /var/backups/app.

Why → --system uses a low UID range and no aging; nologin blocks interactive shells while still allowing the process to run as that user.

Interview tip → Mention systemd DynamicUser=yes as an alternative when the service needs no persistent identity.

All Linux questions Roadmap: Linux

More on Users, groups and access control