LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to add a putty generated .ppk key (https://www.linuxquestions.org/questions/linux-general-1/how-to-add-a-putty-generated-ppk-key-654499/)

ZAMO 07-09-2008 01:07 AM

How to add a putty generated .ppk key
 
Hi,


I want to add a putty generated key(say mykey.ppk) to .ssh/authorized_keys of my Linux box. How can i do it??

Is there a DOC , which helps me to know more about adding keys generated using various tools like putty, openssh,sshkeygen etc...

Will be handy to get one.

Thanks In Advance

blackhole54 07-09-2008 05:54 AM

Sorry, its been a while since I've looked at putty. Is the .ppk just a public key file? If so, you should be able to (if you've copied the file to your home directory and that is your current directory):

Code:

cat filename.ppk >> .ssh/authorized_keys
Be sure you redirect with two greater than signs (>>). If you use only one (>), it will wipe out anything already in authorized_keys.

If you want to delete or modifiy a line in authorized_keys, it is just an ASCII file so you can edit it with any text editor. Just be aware that the lines are quite long so a given line will probably wrap several times in your display.

Edit: When I speak of editing a line in authorized_keys, I am referring to the beginning of the line where you can add various options. Obviously you would not want to modify a key itself! See the AUTHORIZED_KEYS FILE FORMAT section of the sshd man page for more info. If you don't need/want any of these options then you don't need to worry about editing a line.

yummycheese 07-10-2008 07:49 PM

open the file back up with puttygen and copy paste the key out of there.

When you open it with putty gen it will give you a box with the instructions
"Public key for pasting into OpenSSH authorized_keys file"

Just remember.

Public key goes into the authorized_keys file on the host you want to ssh into.

Private key stays with you on the box your sshing from.


All times are GMT -5. The time now is 08:38 PM.