Interview Prep/Linux/Networking, SSH and remote access

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 →

  1. Humans: passphrase-protected keys with ssh-agent, or FIDO2 keys (ssh-keygen -t ed25519-sk).
  2. 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
  1. 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.

All Linux questions Roadmap: Linux

More on Networking, SSH and remote access