Indiana University


ComputerScience






 Home

 Contacts

 Courses

 Academics

 Careers

 Research

 People

 Calendar

 Resources

 Facilities
   FAQ
   System Notices
   Help
   Hardware
   Software
   Network
   Policies
   CSG Staff
   Lindley Hall

CSG FAQ

Q: How do I get CS/OpenSSH and SSH2 systems to interoperate?

If you are loading your OpenSSH keys via ssh-agent/ssh-add, you will be able to ssh to other CS and UITS machines running OpenSSH without a password. To do this, you just need to add the contents of your public key (~/.ssh/id_dsa.pub) to your authorized_keys file (~/.ssh/authorized_keys) on the remote system. However, you will find that this doesn't work when sshing to/from a remote system that is running the SSH2 daemon from ssh.com. Luckily, there is an easy workaround.

For example, if you want to get your non-CS ssh2 public key loaded into your authorized_keys file on a CS system, follow these steps:

  1. Copy your ssh2 public key from your non-CS account to your CS account. By default, your ssh2 public key is named ~/.ssh2/id_dsa_1024_a.pub so you can copy it by running something like:

    scp ~/.ssh2/id_dsa_1024_a.pub school.cs.indiana.edu:.ssh/remote_ssh2.pub

  2. Run the OpenSSH version of ssh-keygen on your non-CS ssh2 public key to convert it into the format needed by OpenSSH. This needs to be done on the system running OpenSSH (ie. a CS system):

    school% ssh-keygen -i -f ~/.ssh/remote_ssh2.pub > ~/.ssh/remote_openssh.pub

  3. Append this newly generated OpenSSH public key to your authorization file on the CS system:

    school% cat ~/.ssh/remote_openssh.pub >> ~/.ssh/authorized_keys

  4. Once this is done, the .pub files you created are no longer needed so you can remove them if you like.
If you want to go the other way, the procedure is similar. For example, if you have an OpenSSH public key (such as would be generated by running ssh-keygen on a CS system) and you want to load it into your authorization file on a non-CS machines running SSH2, follow these steps:

  1. Run the OpenSSH version of ssh-keygen on your OpenSSH public key to convert it into the format needed by SSH2 on the remote machine. This must be done on the system running OpenSSH (ie. the CS system):

    school% ssh-keygen -e -f ~/.ssh/id_dsa.pub > ~/.ssh/csci_ssh2.pub

  2. Copy this ssh public key to your .ssh2 directory on the remote system running SSH2:

    school% scp ~/.ssh/csci_ssh2.pub some.remote.system:.ssh2/csci_ssh2.pub

  3. Add this new pub key to the authorization on the non-CS machine running SSH2. For example:

    remote_system% echo Key csci_ssh2.pub >> ~/.ssh2/authorization

  4. Once this is done, the temporary .pub file you created on the machine running OpenSSH (~/.ssh/csci_ssh2.pub in this example) is no longer needed so you can remove it. DO NOT remove the pub file you just copied to the remote machine.



See an error in this FAQ entry? Please report it.

[Return to the FAQ index]









Valid HTML 4.01!