Join GitHub today
Make use of ssh_config where possible #3
Paramiko offers an API for reading users' SSH config settings. We can use this, at the very least for host aliasing/settings (e.g. default SSH username different from local username; host "foo" actually having hostname of "bar"; etc) although the more esoteric settings may not be supported by Paramiko itself, such as agent forwarding.
The Paramiko SSHConfig class API is pretty basic: just
Main question is how to integrate the host info with
Someone using Fabric with this file could expect the following:
Additional "DNS"-like mappings
Since this is just a supplement to Fabric's functionality, it should probably be on by default, with an option for deactivating it.
In terms of what is displayed to the user, offhand I'd display the "key" hostname (
In the absence of
When the username is set by the Fabric fabfile or CLI flags, however, it gets a bit trickier. I think it obvious that a full host string would take precedence, i.e.
This will entail a little more thought (though in this specific example I'd argue that the more specific setting, across both Fabric and ssh_config, should win -- just like how ssh_config-only things resolve.)
Originally submitted by Jeff Forcier (bitprophet) on 2009-07-20 at 04:59pm EDT
Ustun Ozgur (ustun) posted:
Does the dev version honor ~/.ssh/config settings for ports other than 22? I have defined non-standard ports for my servers, but with fabric, I have to specify not only the hostname, but also the port number; even though with ssh I can just login. I can file a new ticket if it isn't so.
on 2010-07-07 at 04:01am EDT
Jeff Forcier (bitprophet) posted:
No work has been done on the ticket at this point in any branch, so your ssh_config file shouldn't be read at all at this point in time -- it won't affect Fabric in any way.
When we do implement this feature, it'll definitely honor the Port specifier, since we already have support in Fabric for port specification.
on 2010-07-07 at 09:35am EDT
referenced this issue
Dec 20, 2011
This was referenced
Jan 30, 2012
The core user/host/port aspect of this (including all docs, tests etc) has been implemented; remaining is the SSH key aspect, plus the timeout/num-connections. Not sure if it makes sense to set those inside
referenced this issue
Feb 3, 2012
Gonna mark this done, at least until anybody finds more bugs in it :)
There are additional potential config settings we could pull in but those were not worth doing at this point in time -- they really want a serious overhaul to