Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use PPK file in Mac Terminal to connect to remote connection over SSH [closed]

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).

like image 532
Anand Avatar asked Oct 19 '22 08:10

Anand


People also ask

How do I run a PPK file on Mac Terminal?

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. There is a way to do this without installing putty on your Mac.

How do I log into PPK on Mac?

To use ppk keys generated with Putty on Mac OS X, you need to convert them first: After launching puttygen.exe (...) open the . ppk file, enter your passphrase and go to “Conversions” in the menu.

Can I use PPK for SSH?

Generate a ppk fileLocate the private SSH key that you have downloaded. Note: You will need to choose to display All Files* from the menu to the right of the File Name field. Enter the password for your SSH Key. Click the Save private key button to create the ppk file.

How do I connect to a PPK file?

Open PuTTY and navigate to Connection > SSH > Auth. Click the Browse button near the Private key file for authentication field. Select the . ppk file you generated and then click Open.


1 Answers

You can ssh directly from the Terminal on Mac, but you need to use a .PEM key rather than the putty .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 via port or brew:

sudo port install putty

or

brew install putty

This will also install puttygen. To get puttygen to output a .PEM file:

puttygen privatekey.ppk -O private-openssh -o privatekey.pem

Once you have the key, open a terminal window and:

ssh -i privatekey.pem [email protected]

The private key must have tight security settings otherwise SSH complains. Make sure only the user can read the key.

chmod go-rw privatekey.pem
like image 433
Purpletoucan Avatar answered Oct 20 '22 22:10

Purpletoucan