> On 21/06/2017, at 9:09 PM, Matt Magoffin <apache....@msqr.us> wrote:
> 
> I am evaluating embedding Apache sshd with support for reverse port 
> forwarding. That is to say, I wish to execute a command on some client-host 
> like this:
> 
> ssh -N -T -R 49501:localhost:22 user@apache-sshd-host

With debug logs enabled on the client-host, I saw this:

ssh[1385]: debug1: remote forward success for: listen 49501, connect 
localhost:22
ssh[1385]: debug1: All remote forwarding requests processed
ssh[1385]: debug1: client_input_channel_open: ctype forwarded-tcpip rchan 0 win 
2097152 max 32768
ssh[1385]: debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 49501, 
originator 127.0.0.1 port 50936
ssh[1385]: WARNING: Server requests forwarding for unknown listen_port 49501
ssh[1385]: debug1: failure forwarded-tcpip

I then tried changing the -R option to include an explicit bind address of 
127.0.0.1, like this:

ssh -N -T -R 127.0.0.1:49501:localhost:22 user@apache-sshd-host

and after that, the connection succeeds:

ssh[1489]: debug1: client_input_channel_open: ctype forwarded-tcpip rchan 0 win 
2097152 max 32768
ssh[1489]: debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 49501, 
originator 127.0.0.1 port 50952
ssh[1489]: debug2: fd 4 setting O_NONBLOCK
ssh[1489]: debug2: fd 4 setting TCP_NODELAY
ssh[1489]: debug1: connect_next: host localhost ([::1]:22) in progress, fd=4
ssh[1489]: debug3: fd 4 is O_NONBLOCK
ssh[1489]: debug3: fd 4 is O_NONBLOCK
ssh[1489]: debug1: channel 0: new [127.0.0.1]
ssh[1489]: debug1: confirm forwarded-tcpip

— m@

Reply via email to