mc-node.net →

How do I set up SSH keys?

🖥️ VPS · Updated 05/03/2025
For this guide you need an SSH client; in this article we use PuTTY.You can find the credentials (IP address and root password) in the email you received after ordering the VPS.
  1. Open PuTTYgen.

How do I set up SSH keys?

  1. Make sure Parameters Type to generate is set to rsa.

How do I set up SSH keys?

  1. Click the Generate button.

How do I set up SSH keys?

  1. Move your mouse back and forth over the empty area below the loading bar.

How do I set up SSH keys?

  1. Enter a strong password in Key passphrase and enter the same password in Confirm passphrase. (Note: if you forget this password, you will no longer be able to use your SSH key.)

How do I set up SSH keys?

  1. Copy everything in the box Public key for pasting into OpenSSH authorized_key file and save it somewhere safe, because you will need it later.

How do I set up SSH keys?

  1. Then click Save Private key. (Store this one safely as well.)

How do I set up SSH keys?

  1. Log in to the SSH of your VPS (this does not work with Windows VPSes, only with Ubuntu and CentOS VPSes).
You can find the instructions for this here.
  1. Use the following command to create the ~/.ssh directory if it does not exist yet, and add the authorized_keys file inside it.
mkdir ~/.ssh/ && touch ~/.ssh/authorized_keys
  1. Open the authorized_keys file with this command:
nano ~/.ssh/authorized_keys
  1. Paste the text you copied in step 6 using your right mouse button, then save the changes and close the file (ctrl + x > y > ENTER).
  2. The permissions on the .ssh folder and the authorized_keys file are set incorrectly by default. The .ssh folder should only have read, write, and execute permissions, and the authorized_keys file read and write permissions. You can change this with the following commands:
chmod 700 ~/.ssh/
chmod 600 ~/.ssh/authorized_keys
  1. SSH keys exist to better secure your server; for this to work properly you need to disable logging in with the normal password. To do this, open the SSH config file as follows:
sudo nano /etc/ssh/sshd_config
  1. Change the value of PasswordAuthentication to 'No', that is:
PasswordAuthentication no

Then save the changes and close the file (ctrl + x > y > ENTER).

  1. Finally, restart the SSH server to apply the changes:
systemctl restart sshd
With this article you should have been able to install SSH keys on your VPS/dedicated server. If it still didn't work, our staff is ready to help you: Contact us