Bug 351

Summary: wishlist: aliases in .ssh/config
Product: Portable OpenSSH Reporter: Felix Lee <hssnepole>
Component: sshAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED WONTFIX    
Severity: enhancement    
Priority: P2    
Version: -current   
Hardware: Other   
OS: Other   

Description Felix Lee 2002-07-11 08:14:29 AEST
The problem:

I've got access to several domains that get different ssh configuration options,
such as
   Host *.someplace.com
     User felix
     ForwardX11 yes
   Host *.anotherplace.com
     User flee
     Spandex yes
     [etc...]

which is simple enough, but then there are several hosts within each domain that
I'd like to refer to with short aliases, which means adding many lines like
   Host z
     Hostname zymurgy.anotherplace.com

which is also simple enough, but then each of these has to include all the
options that I've specified for *.anotherplace.com too.  This is more awkward
and messy than I think it should be.

Potential solution 1:

I'd like a new config directive like "HostAlias X Y" which would be something
like this: When I do "ssh z" and it sees the .ssh/config line
     HostAlias z zymurgy.anotherplace.com
then it replaces its idea of the hostname with zymurgy.anotherplace.com and then
continues scanning the config file for options pertaining to that.

Potential solution 2:

Add a new configuration directive "SeeAlsoHost X".  When ssh processes that
directive, it re-reads .ssh/config for settings that pertain to host X.  This is
more complicated than solution 1, but more general and maybe more useful.

I haven't looked at implementing either of these.  If nobody else does, I might
get to it in a couple months.
Comment 1 Damien Miller 2005-04-21 17:59:27 AEST
This would be quite difficult to implement with the current parser. If really
have so much repetition in your config that this is necessary, then I suggest
you work around the lack by generating the config using M4 or similar. 

WONTFIX, unless someone actually comes up with a patch.
Comment 2 Darren Tucker 2006-10-07 11:35:32 AEST
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.