I had some problems lately trying to connect to a customer’s server via SSH on my mac running Mac OS X 10.4.11. I was trying to use the provided .ppk file in mac’s OpenSSH command line tool, which didn’t work and just told me: “Permission denied (publickey).” after promting me to “Enter passphrase for key ‘[keyfile.ppk]‘”… so I looked around a bit and after a while came across a great little article on the topic right here.
So in order to use the private key file for putty.exe (the .ppk file) you need to convert it to a OpenSSH file first. The tool you need is called PuTTYgen and only runs in Windows. I have not come across a mac app to do that (too bad). Anyways, the only thing you have to do after launching puttygen.exe is to open the .ppk file, enter your passphrase and go to “Conversions” in the menu. Then save the file as an OpenSSH file.
Finally, after you put the .ssh file on your mac, you need to restrict the .ssh file’s permissions (“Get Info”, then under “Ownership & Permissions”->”Details” set “No Access” for both “Group” and “Others”). Otherwise OpenSSH won’t let you use the file. Now you can connect to the server using this command line:
comp:~ your$: ssh -2 -i /path/sshfilename.ssh user@server.domain
Option “-2″ is not required, at least for me and in this case. It forces ssh to protocol version 2, but it works without. This depends on the protocol the server requires and you need to try this. Also check out the ssh manual (type “man ssh”).
Recent Comments