[CentOS] SSH Migration -- Conversion

Wed Mar 22 15:22:58 UTC 2006
Robert Moskowitz <rgm at htt-consult.com>

I sent the following to secureshell at securityfocus.com (after 
subscribing), but have not seen it posted. Probably my old mail 
server software that I will be using for a few more weeks...

==================================================================

I have been running the commercial SSH for a long time.  I want to 
(for now at least) migrate my user keys to my Linux platform running openSSH.

There are two files in my C:\Documents and Settings\user\Application 
Data\SSH\UserKeys  directory:

user.pub
user

These files start with:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "My Network [2048-bit dsa, user at host, Tue Jan 15 2002 04:27:29]"

and

---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----
Comment: "My Network [2048-bit dsa, user at host, Tue Jan 15 2002 04:27:29]"

So I need some magic to move the files.   I have another notebook 
already on Linux and it has the SSH service running if there is 
someway I could upload the files there and then copy them over to the 
new system.

I have also, in the past, learned to manually upload the pub file to 
a SSH server that did not have the SCP available by:

2.  Log on to the servervusing password authentication.

mkdir .ssh

cd .ssh

3.	On your local machine, use Notepad.exe to open your SSH local 
public key file.  This can be normally be found in:

C:\Documents and Settings\testuser1\Application Data\SSH\UserKeys

4.	With the key file opened in the Notepad application, open the Edit 
menu and choose Select All. Once everything is selected, open the 
Edit menu again and select Copy.

5.	On the server, complete the following steps:

	cat > ~/.ssh/identity.pub

Paste the contents of the Clipboard (which should now contain the 
contents of your key file).

	Issue a CTRL+D to close the identity.pub file.

Convert the key to one that SSH will recognize using the following command:
	/usr/bin/ssh-keygen -X -f ~/.ssh/identity.pub >> ~/.ssh/authorized_keys2


	Be sure to complete step 5-d.

So I ASSuME this is how I can move my public key.  How to move my 
private key and passphrase protect it?