(dv):Create SSH key in PuTTY
- This page was last modified on December 13, 2010, at 21:03.
From (mt) Community Wiki
Contents |
This article will guide you through using SSH keys with PuTTY.
Overview
Generally, you connect via SSH by telling the server your password. You can add another layer of security by using an SSH key. This is a key pair: A public key and a private key.
Download PuTTY
You will need PuTTY, PuTTYgen, and Pageant. You can either download them individually here or you can download the .zip file containing all the binaries (except PuTTYtel) and also the help files here.
Generate the key
Click Generate and move your mouse.
Once the key is generated, enter your Key passphrase. Be sure to use a strong password; read our guide here.
Then click Save public key and Save private key.
Select & configure your user
Let's choose a user for which to create the SSH key. In our example, the user is thatguy for mt-example.com. This is an already existing FTP user with SSH access.
Connect to your (dv) Dedicated-Virtual Server as the root user.
su thatguy
cd /var/www/vhosts/mt-example.com
mkdir .ssh
chmod 700 .ssh
cd .ssh
vi authorized_keys2
Cut and paste on one line your public ssh key.
It should look something like:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBvo93MZvQS8gtB5+fy8yPT+6SrZfJAA4C4lJYydp/pf8KfXTU303xLiTSrXcwDOSUykBi7DVdloOIpZQtQOFJMEwXx+wMWausxp0T5W//pfMfZYTg4ZDDQwWG4bUAl+l6pFDwQwEtm2KN6C4lyfJNMDNqdtjqw9/HvAfO5xoyceQ==
Now, let's protect that file and change owner to thatguy.
chmod 600 authorized_keys2 chown thatguy:psacln .ssh
Add the private key
This application runs in the background. When it loads, it should be displayed in your tray.
Right click the icon and click on Add Key.
Connect using your SSH key with PuTTY
Open PuTTY and connect as thatguy@mt-example.com.
Since Pageant.exe has your passphrase stored, you connect without entering your password:

