A team wants a shared Git deploy user on the server, but you need to know who deployed. How do you design it?
IntermediateScenarioUsers, groups and access control
Answer
Situation read → Shared account, individual identity.
What I'd do →
- Put each person's key in
~deploy/.ssh/authorized_keyswith a forced command and env tag:
command="/usr/local/bin/deploy-wrapper alice",no-port-forwarding,no-pty ssh-ed25519 AAAA... alice
- The wrapper logs
aliceplus$SSH_ORIGINAL_COMMANDto syslog and runs only allowed actions. - sshd also logs the key fingerprint per login (
LogLevel VERBOSE).
Why → You keep a single deploy account but every action is tied to a key owner.
Interview tip → Better long-term answer: deploy from CI with a dedicated identity, not humans over SSH.
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?BeginnerA 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?BeginnerYour security team requires passwords to expire every 90 days for human users only. How do you implement it?Beginner