Chapter 9 · 9.1
Locked out: you can no longer reach your server
Can't get in after changing the firewall or SSH settings? Don't panic. Work through these steps from top to bottom.
1. Is your VPS running?
Check the VPS screen. If it is off, click Start. If it says Suspended, check My Invoices.
2. Log in via the console
In the VPS screen, click Console (see The console: your VPS in your browser) and log in as root with the root password. Forgotten it? Set a new password first in the Settings tab.
3. Undo your last change
| What did you change? | How to undo it in the console |
|---|---|
| Firewall with ufw | ufw disable, then ufw allow OpenSSH and ufw enable |
| Firewall with nftables | nft flush ruleset (until the next restart), then fix /etc/nftables.conf |
| SSH settings | mv /etc/ssh/sshd_config.d/00-eigen.conf /root/, then sshd -t and systemctl restart ssh |
| Blocked by fail2ban | fail2ban-client set sshd unbanip followed by your own IP address |
Wrong permissions on ~/.ssh | chmod 700 /home/anna/.ssh and chmod 600 /home/anna/.ssh/authorized_keys, owner with chown -R anna:anna /home/anna/.ssh |
Check the journal to see what the SSH server says about your login attempt: journalctl -u ssh -e.
4. Still stuck, even via the console?
- Take a snapshot of the current state (see Snapshots: a safety net for every major change).
- Restore a backup from a day when everything still worked (see Restoring backups from WebOké), or
- boot from an ISO in rescue mode and undo the setting on the disk (see Reinstalling or attaching an ISO).
