Your team uses password-protected SSH keys but automation needs to SSH without prompts. How do you balance the two?
IntermediateScenarioNetworking, SSH and remote access
Answer
Situation read → Humans and machines need different keys.
What I'd do →
- Humans: passphrase-protected keys with
ssh-agent, or FIDO2 keys (ssh-keygen -t ed25519-sk). - Automation: separate key per system, no passphrase, stored in a secret manager, restricted on the server:
from="10.0.5.0/24",command="/usr/local/bin/backup-receive",no-pty,no-port-forwarding ssh-ed25519 AAAA... ci-backup
- Rotate machine keys on a schedule.
Why → A leaked automation key can only do one thing from one network.
Interview tip → Never reuse a person's key in CI.
More on Networking, SSH and remote access
A key belonging to a departed engineer may be in `authorized_keys` on 300 servers. How do you rotate SSH keys across the fleet?IntermediateYou need to reach a database on a private subnet from your laptop through a bastion. How?BeginnerYour security team wants SSH hardened on all servers. What changes do you make?BeginnerA new server needs a static IP, gateway and DNS on RHEL 9. How do you configure it persistently?BeginnerYou're changing the network config of a remote server over SSH and could lose access. How do you protect yourself?IntermediateA web server should accept HTTP/HTTPS from anywhere but SSH only from the office. Configure the firewall.Beginner