Nifty ssh/config Entry – March 14, 2026

I've done some interesting things in the past with the config file for the ssh client, but ChatGPT pointed out a neat way to manage an ssh server for which you have two ssh keys and want to be able to login easily to each one at different times.

In my case, I'm using Subversion, and use the svn+ssh method of connecting.  And I have two users (one for the main LifeType source code and one for my customizations.

By using aliases in the config file for the Host, then I can direct it to use different ssh keys for each host and then all of the regular subversion commands just work without further thought.

Host svn.limedaley.com
  User svn

Host lifetype.limedaley
  HostName svn.limedaley.com
  User svn
  IdentityFile ~/.ssh/id_rsa_lifetype

svn.limedaley.com is the actual hostname of my Subversion server, and lifetype.limedaley is an unresolvable alias, but I can then checkout:

svn+ssh://lifetype.limedaley/

and 

svn+ssh://svn.limedaley.com/

and they point to a completely different subversion repo!

(Obviously, the .ssh/authorized_keys needs to be setup appropriately on the server, using a different tunnel user and/or repo depending on what you are trying to do)

As a side-note, I hadn't thought about how trivial it is to put the User svn entry, so then that can be left off the svn checkout command as well.


Questions? Have Anything to Add?
(your comments will be published on this site - click here for private questions)