Bug 351 - wishlist: aliases in .ssh/config
Summary: wishlist: aliases in .ssh/config
Status: CLOSED WONTFIX
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: -current
Hardware: Other Other
: P2 enhancement
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-11 08:14 AEST by Felix Lee
Modified: 2006-10-07 11:35 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.