Friday, November 1, 2013

Migrating Bitvise SSH keys to Linux

If you're using Bitvise as a Windows SSH/SFTP client, and need to migrate/copy a public/private key over to Linux, there are a few steps involved.

1. Using keypair manager in Bitvise, export the public key to Standard SSH2 format. Save as id_rsa.pub .
2. Back in keypair manager, export the private key in OpenSSH format; it will ask if you want to keep the current passphrase or not. Save as id_rsa.pem .
3. Using Bitvise or other software, copy the new files over to the remote system.
4. Login to the remote system and become root.
5. Make sure the files are in the /root/.ssh directory. If you have to create the directory, make sure you run chmod 700 /root/.ssh .
6. In the ssh directory, run openssl rsa -in id_rsa.pem > id_rsa , and enter the passphrase as needed.
7. You can delete the id_rsa.pem file.
8. chmod 600 /root/.ssh/*
9. Remember to delete unsafe copies of the private key.

No comments:

Post a Comment