When managing secure SSH connections, different applications often require different key formats.
While Xshell, a powerful terminal emulator, is fully compatible with OpenSSH key files, other applications like HeidiSQL often require a .ppk
key for authentication.
If you have an RSA OpenSSH key and need to use it with an application that requires a .ppk
key, don’t worry!
Converting your RSA OpenSSH key to a .ppk
key is straightforward. In this guide, we’ll walk you through the process step by step.
Step 1, Convert the OpenSSH Key to .pem
Format (if Necessary)
If your RSA key is already in OpenSSH format, you can skip this step. However, if your key is in another format, you’ll need to convert it to .pem
format. Here’s how:
- Open your terminal.
- Run the following command:
1 |
ssh-keygen -p -m PEM -f your_key_file |
Replace your_key_file
with the name of your RSA key file. This command converts your key to PEM format, making it compatible with the next step.
If You are using XShell,
- Open XShell
- Click Tools
- Click ‘User Key Manager’
- Select the key
- Export the key to .pem format
likc ‘user key manager’
Step 2: Convert the .pem
Key to .ppk
Using PuTTYgen
Now that you have your key in .pem
format, it’s time to convert it to .ppk
using PuTTYgen, a tool specifically designed for this purpose.
Open PuTTYgen: If you don’t have PuTTYgen installed, you can download it from the official PuTTY website.
Load Your .pem
Key:
- Click on “Load” and navigate to the location of your
.pem
file. - Select the file and click “Open”. If your key is encrypted, you’ll be prompted to enter the passphrase.
Save the Key as .ppk
:
- Once the key is loaded, you’ll see the key details displayed in PuTTYgen.
- Click on “Save private key”. PuTTYgen will ask if you want to save without a passphrase. It’s generally safer to keep a passphrase, but you can choose according to your preference.
- Save the file with a
.ppk
extension.
Step 3: Use the .ppk
Key in Xshell
With your .ppk
key ready, you can now configure Xshell to use it for SSH authentication.
Open Xshell and Access Session Properties:
- In Xshell, open the session you wish to configure.
- Go to Properties by right-clicking the session name or selecting it from the toolbar.
Configure SSH Authentication:
- In the session properties, navigate to SSH > Authentication.
- Choose “Public key” as the authentication method.
- Click on “Browse” and select the
.ppk
file you just created.
Connect Using the .ppk
Key:
- Save your settings and connect to your server using the newly configured session.
Conclusion
And there you have it! Converting your RSA OpenSSH key to a .ppk
key and using it in Xshell is a breeze with these simple steps.
This method ensures that your SSH connections remain secure and compatible with Xshell’s authentication system.
If you found this guide helpful, be sure to share it with others who might be navigating the same issue.