Bug 2218 - ProxyCommand as both a resolver and connector
Summary: ProxyCommand as both a resolver and connector
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 6.5p1
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-27 18:13 AEDT by Igor Bukanov
Modified: 2019-05-03 13:55 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Bukanov 2014-03-27 18:13:32 AEDT
The hostname canonicalization configuration options is still rather limited. As that works on DNS level they are of not use if one has to use ProxyCommand to connect over a proxy connection or through a gateway where one uses different port numbers to connect to different intranet names.

What would be ideal is to extend the ProxyCommand to both return the resolved universal name for the given short name and to connect to that universal name. For example, the proxy can first print the resolved name on its stdout before proceeding with other data. Those other data may be a socket if the proxy utilizes the ProxyUseFdpass option.

Another possibility is to allow an external command to serve as a resolver. For example, for the given name such command is supposed to returns the full name that is used for the key lookup and optionally the ip address and port to connect to. The drawback of this is that the proxy command may need to duplicate the functionality of a custom resolver as to geta fully qualified form the resolver may need to figure out what use to connect to that host.

As a custom resolver may reintroduce the rogue DHCP server problem discussed in [1], I suppose the returned name should present on CanonicalDomains list.

[1] - http://blog.djm.net.au/2014/01/hostname-canonicalisation-in-openssh.html

The name returned by the custom resolver must be a subject to the same rules that hostname canonicalization uses. Otherwise one can trivially reintroduce a problem of that the the  that the resolver has to be written carefully as it trivially
Comment 1 Damien Miller 2019-05-03 13:55:47 AEST
I think at the point when you want a proxy command to rewrite hostnames, you'd be better off wrapping ssh in the proxy command itself rather than building a complicated to-and-fro between them.