eolas/neuron/7aecb0c4-f9f9-4579-9564-8a4cb5e9c958/Disable_non-root_ssh_access.md

28 lines
483 B
Markdown
Raw Normal View History

2025-02-16 15:17:25 +00:00
---
tags: [server-management, ssh, procedural, linux]
created: Saturday, February 15, 2025
---
# Disable non-root SSH access
Best practice is to:
- Disallow root login
- Block password-based login
- Allow only SSH-based login
Do this by editing `/etc/ssh/sshd_config`:
```
PasswordAuthentication no
ChallengeResponseAuthentication no
```
Then restart the SSH service:
```
sudo systemctl restart sshd
```
(Assumes you have already set-up SSH-based login for a non-root user!)