You can log in to your SSH app with a key instead of typing your password each time. Setup takes about five minutes, and your password keeps working as a backup.
You’ll need these from your SSH app details. In the commands below, replace USERNAME, PORT and SERVER with your own values.
| Server | SERVER, for example nl5511.dediseedbox.com |
|---|---|
| Port | PORT, your SSH app’s port |
| Username | USERNAME |
| Password | Your SSH app password, needed once to add your key |
Skip this section if you already have a key. You can check with ls ~/.ssh/id_ed25519.pub on Mac or Linux, or dir $env:USERPROFILE\.ssh\id_ed25519.pub in Windows PowerShell.
ssh-keygen -t ed25519This creates two files:
id_ed25519 is your private key. Never share it or copy it anywhere.id_ed25519.pub is your public key. This is the one you add to your SSH app.Using PuTTY? Skip to option C in the next section. PuTTY makes its own keys.
Your keys are kept in one file: /downloads/Apps/SSH/authorized_keys. Pick whichever option suits you.
cat ~/.ssh/id_ed25519.pub | ssh -p PORT USERNAME@SERVER "cat >> /downloads/Apps/SSH/authorized_keys"
Enter your password when asked. That’s the last time you’ll need it.
Type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh -p PORT USERNAME@SERVER "cat >> /downloads/Apps/SSH/authorized_keys"
Enter your password when asked. That’s the last time you’ll need it.
ssh-copy-id doesn’t work with your SSH app, because it saves keys to a different place. Use the commands above instead.
PuTTY uses its own key format, made with PuTTYgen.
.ppk file.nano /downloads/Apps/SSH/authorized_keys.ppk file under Private key file for authentication.Don’t use PuTTYgen’s Save public key button for this. It saves the key in a format your SSH app won’t accept.
Edit the file directly from your file manager or SFTP app.
/downloads/Apps/SSH/.authorized_keys in a text editor, or create it if it isn’t there. The name has no file extension.Your key works straight away. Log in as usual:
ssh -p PORT USERNAME@SERVER
If you get in without being asked for your password, you’re done. If you set a passphrase, you’ll be asked for that instead, which is expected.
To confirm it’s definitely using your key and not your password:
ssh -p PORT -o PasswordAuthentication=no USERNAME@SERVER
Optional shortcut: add this to ~/.ssh/config on your computer, and you can then connect with just ssh seedbox. Rsync, scp and SFTP apps use it too.
Host seedbox
HostName SERVER
Port PORT
User USERNAME
IdentityFile ~/.ssh/id_ed25519
/downloads/Apps/SSH/authorized_keys./downloads/Apps/SSH/authorized_keys. Do this straight away if a device is lost or you no longer use it.cat /downloads/Apps/SSH/authorized_keys, including the exact name with no file extension. Then check each key is a single unbroken line starting with ssh-ed25519 or ssh-rsa. Copying from some terminals splits long lines./downloads/Apps/SSH/authorized_keys. Load your .ppk in PuTTYgen and copy the “Public key for pasting” text into the file again.ssh -i /path/to/key -p PORT USERNAME@SERVER.ssh -v -p PORT USERNAME@SERVER and send the output to support. It never contains your private key.→ Keep your private key private. Only ever copy the .pub file or PuTTYgen’s “Public key for pasting” text. If you think your private key has been seen by anyone else, remove it from /downloads/Apps/SSH/authorized_keys and create a new one.