
- #PUTTY SSH WITH KEY HOW TO#
- #PUTTY SSH WITH KEY GENERATOR#
- #PUTTY SSH WITH KEY PASSWORD#
If things don’t work, open up a second session to your server or logon locally and monitor ssh login attempts and their error messages in realtime:
#PUTTY SSH WITH KEY GENERATOR#
PuTTY Key Generator saves the key file with line endings.
#PUTTY SSH WITH KEY PASSWORD#
Before you disable password logins in /etc/ssh/sshd_config test if your key authentication works properly. In the file ~/.ssh/authorized_keys each and every key must be on its own single line. In Ubuntu 12.04 the ssh service is called ssh not sshd. If you’re using encrypted home folders store your authorized keys in a place that is accessible to the system before you logon, for example in /etc/ssh/. In that case, see the Troubleshooting section. It should say something like:Īuthenticating with public key for key _ Now try and see if you can logon via PuTTY with your private key. Make the directory ~/.ssh readable for only you and remove the executable bit from the authorized_keys file:ĪuthorizedKeysFile %h/.ssh/authorized_keys Do not copy and paste that but paste it as it showed it to you just after generation in the “Public key for pasting into OpenSSH authorized keys file” field. Note that PuTTY Key Generator saves the key as a file with the key divided into multiple lines. The idea is simple: Public Key Authentication for SSH is well documented, I just want my private key to live on my hardware token instead of being a file on my hard drive. In that file paste the string you copied from PuTTY Key Generator on one single line. Log on as your regular user (not root) and create a file ~/.ssh/authorized_keys. You can also have PuTTY remember your username by entering it under Connection > Data > Auto-login username. Don’t mind the key error just yet, we still need to configure that. Press “Load” and login to your server through regular password authentication. Press “Browse” and select the private key you saved earlier. In the options tree on the left side choose Connection > SSH > Auth. “My Server” – in this case my server is called ubuserv06). Under “Host Name (or IP address)” enter the name or the ip address of your server and under “Saved Sessions” enter the name of the profile you’re creating (e.g. Now close PuTTY Key Generator and start PuTTY. If you lose the file you might lock yourself out of your server. Press “Save private key” and save the file in a location only accessible to you. The extension of this file doesn’t matter. Press “Save public key” and save the file where you can find it. In the “Key passphrase” field enter a hard password. Include “ssh-rsa” and the e-mail address. Save them somewhere, no installation is necessary.Įxecute puttygen.exe and click the Generate button.Įnter your e-mail address in the “Key comment” field.Ĭopy ALL text under “Public key for pasting into OpenSSH authorized_keys file”. Generate a key pairĭownload PuTTY and PuTTY Key Generator from. #PUTTY SSH WITH KEY HOW TO#
Several tutorials were helpful in explaining what to do but in the end I figured out how to go about it. Partly because I didn’t know what exactly I was doing but mostly because I didn’t know how to do it.
This week I had a really hard time getting public key authentication to work with my Ubuntu 12.04 server.