Converting a Putty .ppk file to OpenSSH format requires the puttygen binary that can be installed as follows:
Convert Openssh Key To Putty
- Linux: with your package manager, install PuTTY (or the more minimal PuTTY-tools):
- Ubuntu
sudo apt-get install putty-tools
- Debian-like
apt-get install putty-tools
- RPM based
yum install putty
- Gentoo
emerge putty
- Archlinux
sudo pacman -S putty
- etc.
- Ubuntu
- OS X: Install Homebrew, then run
brew install putty
Place your keys in some directory, e.g. your home folder. Now convert the .ppk file to SSH keypairs.
Openssh Key To Ppk
To generate the private key:
Working with PuTTY’s Public Key Format. You can click Save public key as well, but take note: The format PuTTYGen uses when it saves the public key is incompatible with the OpenSSH authorizedkeys files used for SSH key authentication on Linux servers. If you need to see the public key in the right format after the private key has been saved. Public key authentication. PuTTY uses its own file format for SSH keys. The keys are stored in.ppk files. The PuTTYgen tool can be used for generating new keys and converting between.ppk files and other key formats. It is common for hackers and malware to collect SSH keys when penetrating an organization. Next, click on your name in the top right, go to your settings in the dropdown, click on SSH Keys on the left menu bar, and then enter your keys details. The name of the key can be anything you would like. Paste the public key in the Public Key section, and then click add key. Step 4: Push the key to the server. Now that we have the keys generated and saved, we need to get the keys on the server. Copy the data inside the putty window under Public Key for pasting into SSH authorized keys file. It should look something like this. (Note that the below example is all on one line. Do not use 3 lines, as displayed in the example.). NOTE: PuTTY and OpenSSH use different formats for public SSH keys. If the SSH Key you copied starts with “—- BEGIN SSH2 PUBLIC KEY ”, it is in the wrong format. Be sure to follow the instructions carefully. Your key should start with “ssh-rsa AAAA.” Save The Public Key On The Server; Now, you need to paste the copied public key.
Convert Openssh To Putty
and to generate the public key:
Move these keys to ~/.ssh
and make sure the permissions are set to private for your private key:
The above permissions are based on man ssh
, i.e.:
Source: