Puzzled by -R dropping first argument

Rudolf Potucek RudolfPotucek at smarttech.com
Tue Dec 17 14:37:16 EST 2013


Ok, nevermind, I am an idiot … this is "by design" and requires appropriate setting of GatewayPorts=userspecified on the server.

From: Rudoef Potucek <RudolfPotucek at smarttech.com<mailto:RudolfPotucek at smarttech.com>>
Date: Monday, 16 December, 2013 8:22 PM
To: "openssh-unix-dev at mindrot.org<mailto:openssh-unix-dev at mindrot.org>" <openssh-unix-dev at mindrot.org<mailto:openssh-unix-dev at mindrot.org>>
Subject: Puzzled by -R dropping first argument

Hi All!

I am puzzled. I am using openssh 5.3p1 on RHEL/CentOS but am seeing the same behaviour for osx and debian:

ssh -R xxx:yyy:yyy:yyy remotehost

Will effectively drop the first (xxx) argument and result in

ssh -R 127.0.0.1:yyy:yyy:yyy remotehost
ssh -R yyy:yyy:yyy remotehost

I had a look at the source code where apparently all 4 values are ready and handed down to the appropriate forwarding request. Yet in the end the first argument gets dropped / replaced?

I can see two important uses of -R and would really like to make this work, even if this means I have to patch all my ssh client and server packages:

(1) Allowing the reuse of a local port if something is already listening on that port and the client can only be pointed at an IP, not a custom port:

ssh -R 127.0.0.2:ppp:127.0.0.1:ppp remotehost

which works perfectly in reverse

ssh -L 127.0.0.2:ppp:127.0.0.1:ppp remotehost

but poses a security risk because now the client would know the server password.

(2) Picking an interface in a multihomed system

Any suggestions welcome,

  Rudolf


More information about the openssh-unix-dev mailing list