Add an SSH key to your VPS and turn off password sign-in
Create an SSH key on Windows, macOS or Linux, copy it to your THOST VPS with ssh-copy-id, and optionally turn off password sign-in.
An SSH key is safer than a password and saves typing it. A reinstall always starts with password sign-in, so add your key after each reinstall.
Steps
- Create a key on your computer (skip if you already have one in
~/.ssh/id_ed25519.pub): Press Enter to accept the file name, and choose a passphrase.ssh-keygen -t ed25519 - Copy it to the VPS. Use the command from the Rebuild tab's SSH keys card, which has your port filled in, for example: Enter the VPS admin password once.
ssh-copy-id -p 20000 admin@vps.t-host.co.uk - Test it. Run your normal SSH command. It should sign in without asking for the password (only your key's passphrase, if you set one).
- Turn off password sign-in (optional). Once key sign-in works, edit
/etc/ssh/sshd_configwithsudo nano /etc/ssh/sshd_config, setPasswordAuthentication no, save, and runsudo systemctl restart ssh. Keep your current session open and test a new one before you close it.
Windows without ssh-copy-id
- Show your public key in PowerShell:
type $env:USERPROFILE\.ssh\id_ed25519.puband copy the line. - Sign in to the VPS with the password and run:
mkdir -p ~/.ssh && chmod 700 ~/.ssh && nano ~/.ssh/authorized_keys - Paste the line, save, then run
chmod 600 ~/.ssh/authorized_keys.
Questions
Can I add keys from the dashboard?
Not yet for VPS (it is on the way). Storage Boxes already have an SSH keys tab.
I turned off passwords and lost my key.
Reinstall from the Rebuild tab (it wipes the disk and starts again with password sign-in), or open a ticket.
Did this not solve it? Open a support ticket and tell us which guide you followed. We answer every ticket ourselves.