All tutorials

Tutorials

BandwagonHost VPS GuideSSH5 min read

SSH key login for BandwagonHost VPS

Set up SSH key login and reduce password-login exposure on a new VPS.

SSH keys are safer and more convenient than repeated password login. Configure key login first, verify it works, and only then consider disabling password login.

Create a key pair locally

ssh-keygen -t ed25519 -C "bwg-vps"

Install the public key on the VPS

ssh-copy-id root@YOUR_SERVER_IP

If ssh-copy-id is not available, paste the public key into ~/.ssh/authorized_keys manually and make sure file permissions are correct.

mkdir -p ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Test before changing SSH settings

Open a new terminal and test key login while keeping the existing session open. This gives you a recovery path if you make a configuration mistake.

ssh root@YOUR_SERVER_IP

Optional hardening

After key login is confirmed, you can consider disabling password login in sshd_config and restarting sshd. Keep emergency console access in mind.

More

Keep reading

View all