What is `AuthorizedKeysCommand` used for?
IntermediateProductionSSH & Access Hardening
Answer
sshd runs a program to fetch a user's public keys at login instead of (or in addition to) reading files.
AuthorizedKeysCommand /usr/local/bin/fetch-keys %u
AuthorizedKeysCommandUser nobody
The program prints keys to stdout, e.g. from LDAP/SSSD (sss_ssh_authorizedkeys), IAM, or an internal API. Revoking access centrally takes effect on the next login without touching servers. The command must be root-owned and not writable by others.
More on SSH & Access Hardening
What are the first sshd_config changes you make on a new production server?BeginnerWhy use a drop-in file in /etc/ssh/sshd_config.d/ instead of editing sshd_config?IntermediateWhy disable SSH password authentication entirely?BeginnerShould you change the SSH port from 22?IntermediateWhat are SSH certificates and why do large fleets use them?AdvancedHow do you restrict what a specific SSH key can do?Advanced