Connecting to your VPS with PuTTY on Windows is quite easy. But it can be even easier and faster with RSA keys. In this tutorial we will discuss how to connect to your VPS with RSA keys and PuTTY on Windows.
Requirements
- Have a (Ubuntu 14.04) VPS
- Have PuTTY installed
- Have PuTTYgen installed
Generate RSA keys
- Openup the program PuTTYgen
- Click on ‘generate’
- Move your mouse over the area.
- Save your publickey in a folder you won’t lose
- Save your private key in a folder you won’t lose (ex. Dropbox)
Upload RSA key to VPS
- Login to your VPS using PuTTY and the username password you already had
- Enter the IP in putty
- Change the port if needed
- Press ‘open’
-
1nano ~/.ssh/authorized_keys
- Copy paste the value from your previously saved public key to this file on your VPS
- Save the file (ctrl+o in nano)
Save RSA key in PuTTY
- Open PuTTY
- Enter your IP and port
- Type a name for your VPS under ‘Saved sessions’ and press ‘Save’
- Now go to connection->SSH->Auth and browse for your private key file at the bottom of this screen.
- Go to connection->data and enter an auto-login username to login with (ex. root or your name)
- Go back to Session in the tree on the left
- Save your session again
Disable password login
-
1nano /etc/ssh/sshd_config
- Find PermitRootLogin and change that line to PermitRootLogin without-password
- Save the file using ctrl+o on nano
-
1service ssh restart