I generated a keys with putty w/ no passphrase. putty works fine, but now i installed cygwin and would like to use ssh to login. For some reason i'm prompted for a passphrase? why? putty just logs straight in? i don't want to have to generate a new key and annoy the network admins. here is what it looks like in cygwin: $ ssh -i Documents\ and\ Settings/xxxxx/My\ Documents/xxxxx\ putty\ keys/private\ key.ppk dev.xxxxxx.com Enter passphrase for key 'Documents and Settings/xxxxx/My Documents/xxxxx putty keys/private key.ppk': Permission denied (publickey).
Putty uses its own .ppk format for keyfiles, and Cygwin's ssh probably can't read them correctly.
Solution: convert the .ppk file to OpenSSH key format with puttygen.exe.
You need to get "puttygen.exe" from the putty webpage http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to convert your key to the OpenSSH format. Then it should just work.
If you can login with putty, there is no need to "annoy the network admins". Just generate a new key with cygwin, then login with putty and place your new public key in your .ssh/authorized_keys file. You should now be able to login with cygwin's ssh.
EDIT:
By the way, a sure way to "piss off" any admin is to use unencrypted keys.
You can export PuTTY keys to OpenSSH format and append them to your .ppk file, so that it becomes a valid key for ssh-add.
Just export the private key with PuTTYGen then add it to the .ppk file, then you should be able to ssh-add it. But note that when you edit the .ppk itself with PuTTYGen, it will ovewrite the file.
You can also use a script like this for adding a .ppk file into your SSH agent:
file=~/`basename $0`.tmp
trap "rm -v $file" EXIT
echo -n "Password: "
read -s pwd
echo $pwd | puttygen -P -q -O private-openssh $1 -o $file
ssh-add $file
Source: http://bazaar.launchpad.net/~renatosilva/+junk/scripts/view/head:/ppk-add.sh
© 2022 - 2024 — McMap. All rights reserved.