Quantcast
Channel: User jrwren - Server Fault
Viewing all articles
Browse latest Browse all 14

ssh ProxyCommand and ControlPath to two different hosts with same ip address behind different proxies

$
0
0

The problem:

ssh config with ControlPath set to ~/.ssh/master-%r@%h:%p

A third party tool which invokes ssh with a ProxyCommand ssh <proxyhost> --pty=false nc -q0 %h %p

The problem is that the third party tool might invoke ssh with proxy command with ultimate target host 10.0.0.12 and then AGAIN with the same target host ip, but with a different proxy intermediate.

e.g.

ssh -o ProxyCommand 'ssh proxy1 nc -q0 %h %p' 10.0.0.12ssh -o ProxyCommand 'ssh proxy2 nc -q0 %h %p' 10.0.0.12

If the first command is using Control Master, the second command incorrectly uses ControlPath because 10.0.0.12:22 is there.

Is there a work around or %proxy I can use in ControlPath value?

Update: one workaround which I have yet to try is to export HOME=somewhere_else the next time I run the tool. I should be able to have an alternate .ssh in that alt HOME


Viewing all articles
Browse latest Browse all 14

Trending Articles