0

The process of getting Putty communicating with OpenSSH has thwarted me for quite some time.

I installed OpenSSH with:

sudo apt-get install openssh

Then I generated ssh keys with:

ssh-keygen -t rsa -b 4096 -C "my user here"

The above command moved the public and private key combo to my user's profile home .ssh directory (/home/myUser/.ssh) (I think I may have had to create the .ssh folder there in order for ssh-keygen to work properly)

Then I copied the private key to Windows and tried to use it in Putty. The server kept denying me.

1

These are the steps which I used to fix the problem (I'm answering my own question because this took me two days to figure out).

  1. Go to the Windows firewall and add allow rules to port 22 inbound/outbound.

  2. Make sure to add port 22 inbound / outbound allow rules to Linux IPTABLES.

  3. Inside the /home/myUser/.ssh folder on Linux, copy the public key file (the one that has the .pub file extension) contents into a file called authorized_keys (you'll have to create it, just like you might have to create the directory "/home/myUser/.ssh" (where "myUser" is whatever your username is)

  4. Copy the private key onto the Windows box (client, where putty is installed).

  5. Go to the putty install directory on Windows (typically c:\Program Files\Putty) and run puttygen.exe. Go to the "conversions" tab and import the public key that you copied from Linux. Save it (it'll save as a .ppk file, which is Putty's key format).

  6. When you connect, in the putty left-hand side, go to "SSH", then to "Auth" - under "Auth", load the .ppk format private key you just saved. Then connect. If you're asked for a user/pass, just hit enter on both. You should be connected / see a welcome message.

0

I installed OpenSSH with:

sudo apt-get install openssh

The ssh server is in openssh-server package. SO either you do not have server installed and you are not connecting to your server or it was installed before.

The above command moved the public and private key combo to my user's profile home .ssh directory (/home/myUser/.ssh) (I think I may have had to create the .ssh folder there in order for ssh-keygen to work properly)

It generated your keys on server. But to have the keys "authorized", you need to copy the id_rsa.pub to ~/.ssh/authorized_keys`.

Then I copied the private key to Windows and tried to use it in Putty. The server kept denying me.

PuTTY does not understand the private key in OpenSSH format. You need to convert it to PuTTY format, using PuTTYgen

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.