---
title: "HOST-SSH-013 SSH Authorized Keys Without Restrictions or Protection"
canonical: https://openvapt.com/checks/HOST-SSH-013.html
html: https://openvapt.com/checks/HOST-SSH-013.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-14
version: 0.1.0-alpha.6
---

# HOST-SSH-013 SSH Authorized Keys Without Restrictions or Protection

Checks root's authorized_keys for keys without from= or command= options, and every authorized_keys file for permissive modes.

- Domain: Server
- Severity: Low
- Control category: Identity and Authentication
- Fix effort: low
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:N`
- CIS Controls v8: 4.1
- NIST CSF 2.0: PR.PS-01
- CWE: CWE-732, CWE-250
- NIST SP 800-53 Rev. 5: IA-5, AC-6, AC-17
- Benchmark topic: SSH key management and file permissions (topic only, no benchmark text)

## Why It Matters

A key in root's authorized_keys is a root password that never expires. Restricting it with from= (allowed source addresses) or command= (one fixed command) limits what a stolen key can do. An authorized_keys file that others can write lets them add their own key; one that others can read tells them which keys to steal.

## How It Detects

Reads /root/.ssh/authorized_keys and lists key lines with neither from= nor command=; stats /root/.ssh/authorized_keys and /home/*/.ssh/authorized_keys (metadata only) and flags group or other write, and other read, permissions. Key material is never reported.

## How to Fix

Prefix each root key with options, for example  from="203.0.113.0/24",no-port-forwarding,no-agent-forwarding  or  command="/usr/local/bin/backup",restrict ; chmod 600 ~/.ssh/authorized_keys and 700 ~/.ssh for every account. Prefer sudo from a personal account over direct root keys.

## How to Verify

```
cut -c1-40 /root/.ssh/authorized_keys ; stat -c '%a %n' /root/.ssh/authorized_keys /home/*/.ssh/authorized_keys
```

## Learn the Theory

- [P2 SSH Security](https://openvapt.com/academy/p2.md)
- [P20 Secrets, Cron and Account Hygiene](https://openvapt.com/academy/p20.md)

## References

- [sshd(8), AUTHORIZED_KEYS FILE FORMAT, OpenBSD manual pages](https://man.openbsd.org/sshd.8#AUTHORIZED_KEYS_FILE_FORMAT)
- [NIST IR 7966, Security of Interactive and Automated Access Management Using Secure Shell (SSH)](https://csrc.nist.gov/pubs/ir/7966/final)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/host/hygiene.go

Run it: `openvapt scan --only HOST-SSH-013`. Read it offline: `openvapt explain HOST-SSH-013`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/HOST-SSH-013.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
