Interview Prep/Linux/SSH & Access Hardening

How do you restrict what a specific SSH key can do?

AdvancedProductionSSH & Access Hardening
Answer

Prefix options in authorized_keys:

from="10.0.0.0/16",command="/usr/local/bin/backup-receive",restrict ssh-ed25519 AAAA... backup@ci

restrict disables port, agent and X11 forwarding and PTY allocation; command= forces a single command regardless of what the client asks; from= limits source addresses. This is how we give CI or backup systems narrowly scoped access.

All Linux questions Roadmap: Linux

More on SSH & Access Hardening