Putty is a popular open source SSH client for Windows.
Generate a rsa key pair
Enter a passphrase and save both the private and public key to your local disk. Copy the key from the field (“Public key for pasting into authorized_keys file”).
Now, having created a key, we want to cause it to be trusted by our account on the SSH server. First, in order to allow Pubkey or Identity authentication, the SSH server must have the proper settings in its sshd_config:
# Should we allow Identity (SSH version 1) authentication? RSAAuthentication no # Should we allow Pubkey (SSH version 2) authentication? PubkeyAuthentication yes # Where do we look for authorized public keys? # If it doesn't start with a slash, then it is # relative to the user's home directory AuthorizedKeysFile .ssh/authorized_keys
The settings above are the defaults, which enable Identity/Pubkey authentication for both SSH version 1 and 2, and check for public keys in user's $HOME/.ssh/authorized_keys file.
Make sure you have appropriate entries in sshd_config (typically located in the /etc/ssh/ directory) and restart the server if necessary.
Create a file with the public key just copied from PuttyGen
Create the .ssh dir if it doesn't already exist
mkdir .ssh chmod 700 .ssh cd .ssh
Concatenate the RSA Pubkey we just created to the authorized_keys file. (This will create if it doesn't already exist.)
cat ../root2_793 >> authorized_keys
Let's check out the file
cat authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAukGuAaWB5eQ9FcRP9lt0fh22UviDJsrwmwU /brWdUruI7wDFenJSe9zjZ5RR4WKYVuYIHrsI/YpbY9YSHZ0SEUPED1Ajnrl9trVaiNYD72 wC0gN+Eos6Dqc34pQGyFm/WpkTilovNNIHQBEpnpXbSzc8hk7BL5qgGw2hvNpYGaM= root2_793
Make sure permissions are paranoid.
chmod 600 authorized_keys
Excellent, let's log out.
Choose your existing Session from Putty and press “Load”. Under “Connection/SSH/Auth” select your private key (generated before by PuttyGen)
Enter the username you wan't to use (optional). You'll find this setting under “Connection/Data”
Yor now ready to login! Just enter your passphrase when you are prompted to.
Putty stores its setting in the windows registry and not in a file so it can be hard to share the settings between multiple machines. This guide shows you how to export and import the Putty settings from the registry.
Be careful about what you do in your registry, you should be really sure of…