Wildcard SSH Configuration

I’ve just discovered that you can use wildcards in the local ssh user configuration (~/.ssh/config)

host vm-*
   User virtual-machine-user
   ForwardX11 yes

host board*
   User root

This lets me configure all my ssh access in a very short configuration. My virtual machines have a common prefix, and a common user – so that can all be sorted in one hit.

My target development boards are all identified by a board number (which correlates to its IP address too) such as board2 board3 board240.
Now I no longer have to type ssh root@board2. (Every saving is a saving!)

About Kieran Bingham

A linux and open source software engineer
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>