I have been using Putty on Windows XP and used the .ppk file to connect to my Linux servers (several servers).
On the servers I have the following folder and file ~/.ssh/authorized_keys
I now want to use a Mac to connect via the terminal. I have set up the remote connections to the servers manually and want to know how I can setup using the ppk file or the private/public key within it.
Please note : I already am using private/public key login from Windows so I do not need to create a new key using keygen, I just want to know how to set up now that I have the keys already. (In other words, I already have the authorized key lists on the server, and the public and private key).
There is a way to do this without installing putty on your Mac. You can easily convert your existing PPK file to a PEM file using PuTTYgen on Windows.
Launch PuTTYgen and then load the existing private key file using the Load button. From the "Conversions" menu select "Export OpenSSH key" and save the private key file with the .pem file extension.
Copy the PEM file to your Mac and set it to be read-only by your user:
Then you should be able to use ssh to connect to your remote server
Convert PPK to OpenSSh
OS X: Install Homebrew, then run
Place your keys in some directory, e.g. your home folder. Now convert the PPK keys to SSH keypairs:cache search
To generate the private key:
and to generate the public key:
Move these keys to ~/.ssh and make sure the permissions are set to private for your private key:
connect with ssh server
Port Forwarding to connect mysql remote server
You can
ssh
directly from the Terminal on Mac, but you need to use a.PEM
key rather than theputty
.PPK
key. You can use PuttyGen on Windows to convert from.PEM
to.PPK
, I'm not sure about the other way around though.You can also convert the key using
putty
for Mac viaport
orbrew
:or
This will also install
puttygen
. To getputtygen
to output a.PEM
file:Once you have the key, open a terminal window and:
The private key must have tight security settings otherwise SSH complains. Make sure only the user can read the key.