Get back into a server you're locked out of
Locked out of your server? Pick the right way back in, from an open SSH session to the serial console or rescue mode, without erasing the disk.
If you can't log in to your server, first work out which login is failing, then use the first route below that fits. Every route on this page keeps your files; only a reinstall, the last one, erases the disk.
Which login is it?
- You can't log in to the Rack4 panel (my.rack4.io). That's your account, not the server. Use forgot your password?, or if you lost your phone, your 2FA recovery codes. Your servers keep running meanwhile.
- The panel works, but SSH to the server doesn't. Read on.
If SSH says Connection timed out or Connection refused, the server may be down or blocking the port rather than refusing you, so go through the unreachable checklist first. If it says Permission denied, the server answered and turned down your key or password: the routes below fix that.
1. Use a session that's still open
If you still have an SSH session open somewhere, on another computer or in another terminal tab, keep it open and fix things from there: add your new key to ~/.ssh/authorized_keys, undo the firewall rule, or set a password with passwd root. Test with a second, new connection before you close the old one.
2. Check the panel firewall
If you changed the server's panel firewall rules just before you were locked out, fix the rule in the panel. That needs no login on the server at all.
3. Log in on the serial console
The serial console is the server's own screen in your browser. It doesn't use the network, so it still works after a broken ufw rule, a bad sshd_config or a network change. It logs in with a password, not a key, so it only helps if root (or your own user) has one.
On the console you can fix what's wrong: the console's common fixes cover firewalls, sshd and network settings. To let your key in again, add it to /root/.ssh/authorized_keys.
4. Boot into rescue mode
If there's no password, or the server won't boot, use rescue mode. It shuts the server down and starts a small Debian system with your disk attached, untouched, and gives you a one-time password. From there you can:
- set a new root password with
chroot; - add your public key to
/mnt/root/.ssh/authorized_keysafter mounting the disk; - fix
/etc/fstab, free up a full disk or check the filesystem.
Then leave rescue and the server boots from its own disk. If you forget, rescue ends by itself after 24 hours. A suspended server can't boot into rescue; pay its open invoice first.
5. Revert a snapshot
If a change you made broke the server and you took a snapshot before it, reverting puts the whole disk back to that moment. Anything written since is lost, so use it when the snapshot is recent or the lost changes don't matter.
6. Reinstall, as a last resort
A reinstall gives you a fresh system with the key or password you choose, on the same IP addresses. It erases the disk and every snapshot, so copy off what you need first, from rescue mode if that's the only way in.
When to ask us
Open a support ticket if the console stays blank after a reboot from the panel, rescue mode won't start or leave, or the server shows error. Say which of the steps above you tried and what each one showed; we can look at the host side, which you can't see.