authorized_keys
The file in a user's ~/.ssh directory listing the public keys allowed to log in to that account over SSH.
Any key listed there can log in as that user, so a planted line is a persistent backdoor.
In more detail
Adding a line is granting access; removing it revokes that key. Options on a line can restrict a key, for example to one command or source address. The file and its directory must not be writable by others, or sshd ignores it.
Example
Adding a line here is a quiet way to keep access to a Linux host.Related terms
- SSH key — A key pair used to log in over SSH: the private key stays on your machine and the public key is added to the server account.
- public key — The shareable half of a key pair, used by others to verify your signatures or encrypt data only you can read.
- authorization — Deciding whether an already identified caller may perform a particular action on a particular resource.
- persistence — Anything an attacker sets up so their access survives reboots, logoffs and password changes, such as a scheduled task or a new key.
- sweep — Searching all available logs and hosts, including old data, for a set of indicators to find every place they appear.
Taught in
- SSH Keys, The Agent And The Config File — Linux Fundamentals & Systems Administration
- Repositories You Configure By File — Red Hat Certified System Administrator (EX200) Exam Prep
- Containment & Eradication: Host, Net & Identity — Security Operations & Threat Hunting (SOC)
- SSH Keys And An Account For Ansible — RHCE in Ansible (EX294): Automate Red Hat Systems
References
- OpenSSH sshd manual (AUTHORIZED_KEYS FILE FORMAT)
- RFC 4252: The Secure Shell (SSH) Authentication Protocol
- OpenBSD manual: sshd authorized_keys format