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.
More on Users, groups and access control
You need to onboard 50 new developers onto a shared build server, each with their own account and SSH key. How do you do it?BeginnerThree teams share one server and each needs a project directory only its members can write to, with new files staying group-owned. How do you set it up?BeginnerA junior engineer needs to restart nginx but must not get full root. How do you grant that?BeginnerAn engineer leaves the company today. What do you do with their Linux account on 30 servers?BeginnerYour security team requires passwords to expire every 90 days for human users only. How do you implement it?BeginnerTwo developers need read access to `/var/log/app/` without being added to the `adm` or root group. How?Intermediate