Coming from Linux openssh keygen, where do I put the keys in puTTY?

I have done this before, but so long ago, and cannot recall the gory details. The following is what I remember. However,  the key is refused by puTTY. Tell me where I am going wrong.

On Ubuntu linux under root, I am creating the keypair using: <ssh-keygen -t rsa>.  While in ssh-keygen, I chose ~/.ssh as the location. Then, I made the permission for the .id_rsa private key as: <chmod 700 id_rsa>.  I see the two keys in my .ssh directory.

Still in Ubuntu, I created an authorized_keys file in .ssh with: <touch authorized_keys>. Then I copied the .pub file into authorized_keys with: <cat id_rsa.pub >> authorized_keys.

I do not know what the permissions should be for the key files and the authorized_key file. I am not sure where the authorized_keys file goes.

I am certain that the private key id_rsa remains in the .ssh folder under the user (~/.ssh/id_rsa).

Finally, I am assuming that I should ftp the .pub key to my Windows 7 machine, somehow puTTY will use that file to put the key into a local Windows file named: c:\putty\ privatekeys.pkk.

Someone please tell me where I am going wrong. Thanks in advance.
RayRiderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mcsweenSr. Network AdministratorCommented:
I could post the step by step instructions here but this link gives a detailed tutorial how to set this up.  Like the tutorial, I always generate my keys using puTTYgen from the Windows side then paste my authorized_keys into a text file via ssh terminal.

You will create the keys, copy the public key to ~/.ssh/authorized_keys on the SSH server with 700 permissions, put the private key on the client computer (win 7) and enter it in putty under Connection\SSH\Auth 'Private Key File for Authentiacation'

http://www.ualberta.ca/CNS/RESEARCH/LinuxClusters/pka-putty.html
0
RayRiderAuthor Commented:
Additional comment: In Windows puTTY, I can find NO procedure to use the remote Linux's public key. I see a puTTY key generator that apparently creates the key pair and places the private key into the the file: c:\putty\privatekeys.pkk.

No provisions are made for Windows puTTY to use the remote "public key". At least, that I can determine. I thought the idea was to pass around the public key to the remote host. Apparently, I cannot pass the public key into puTTY, but must go the other way with the Windows puTTY public key being generated by puTTY and transferred to the Linux box. And, I am guessing the "authorized_keys" file in the ~/.ssh directory is where that puTTY public key should go.
0
RayRiderAuthor Commented:
Mcsween:

You were commenting and I was posting additional comment at the same time. Thanks for your link and advice. It appears I had just a few minutes ago figured out what you just told me. Let me give that a try and I will comment back. Thanks
0
Top Threats of Q1 & How to Defend Against Them

WEBINAR: Join WatchGuard CTO and our Threat Research Team on Aug. 2nd to hear the findings from our Q1 Internet Security Report! Learn more about the top threats detected in the first quarter and how you can defend your business against them!

mcsweenSr. Network AdministratorCommented:
Just in case, to comment on your update.

The public key goes on the SSH server, the private key goes in putty (see screenshot)
Enter your username to connect with (see other screenshot)
Once you've entered the settings under Auth and Data go back to the Session section and enter the hostname/IP Address, give the session a name and click Save.  Next time you can just double click on it in the list.

Authentication Steps:
puTTY will connect to the ssh server
SSHD asks puTTY for a username
If you entered a username on the data section puTTY sends the username, otherwise user enters it
puTTY will then attempt to authenticate with pre-entered private key.  If you have a password on this key (you should) then you will be prompted for it.
SSHD compares the private key to it's public key for that user (~./ssh/authorized_keys) and grants or denys access.
If the keys don't match puTTY then prompts your for your password to the SSH server
If they match then bash or whatever shell you are using launches
Capture.PNG
capture1.png
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RayRiderAuthor Commented:
mcsween:

I got it to work finally. I would not follow the instructions in puTTY!!!  Instead of copying the public key at the top window into Windows clipboard as the job aid told me to do, I was clicking on the "save public key" button, and sending that file to the Ubuntu server to be inserted into the authorized_keys file. I have not checked to see what is different. But, once I pasted the screen to notepad and saved it, then ftp'ed the file to the Ubuntu server, the keys are now recognized.

Next, I wish to follow your last procedure to see if that works as well. That is more like the procedure I remembered where the key pairs were generated on Unbuntu and then copied to puTTY on Windows. I just had the keys backward, thinking the private key stayed with the Ubuntu box and the public key went to the Windows machine.

I am closing out and giving you the points. Thanks again!
0
mcsweenSr. Network AdministratorCommented:
An easy way to remember is the server shares it's key with anyone trying to log on as you which would make it public.  The key you have is used to authenticate is private like your password.

Glad you got it working!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Security

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.