Harden SSH on your VPS
Disable password logins, use keys, change the default port only if you understand the risk, and keep a rescue path.
Last updated
Do this on a VPS or dedicated server you administer β not on shared hosting, which has no shell.
- Add your public key to
~/.ssh/authorized_keysand confirm key login works. - Disable root password login in
sshd_config(PasswordAuthentication no,PermitRootLogin prohibit-password). - Create a sudo user and keep a second session open while you reload
sshd. - Optionally move SSH off port 22 and pair it with Fail2ban.
PKHosting will never ask you for your SSH private key or account password.
Still need a hand?
Open a ticket from your dashboard with your domain and a screenshot β our team replies fast.