3

I'm trying to set up a reverse port forward over an existing master channel, but it doesn't seem to be working and I'm not sure why. I set up the master channel like so:

ssh -MN -oControlPath=/tmp/mycontrolpath hostname

and I try to open a reverse port forward like so:

ssh -oControlPath=/tmp/mycontrolpath -NR 10017:127.0.0.1:10017 hostname

but this second process fails with the output

stdin: is not a tty

and no port forward is opened on the remote host. This seems to be a supported feature of the protocol (according to the RFCs, anyway), but I'm getting nowhere fast trying to use it. Has anyone got this to work?

The client SSH version is OpenSSH_5.3p1 Debian-3ubuntu6, OpenSSL 0.9.8k 25 Mar 2009, connecting to OpenSSH_5.5p1 Debian-6, OpenSSL 0.9.8o 01 Jun 2010 on the server.

UPDATE

Running the port-forward command with -vvvv gives this output:

OpenSSH_5.3p1 Debian-3ubuntu6, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /home/regularfry/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug3: ssh_msg_send: type 2
debug3: ssh_msg_recv entering
debug3: ssh_msg_send: type 2
debug3: ssh_msg_recv entering
stdin: is not a tty

The relevant section of the corresponding output from the master socket process looks like this:

debug3: fd 5 is not O_NONBLOCK
debug3: ssh_msg_recv entering
debug3: ssh_msg_send: type 2
debug3: ssh_msg_recv entering
debug3: muxserver_accept_control: receiving 2 env vars
debug2: muxserver_accept_control: accepted tty 0, subsys 0, cmd
debug2: muxserver_accept_control: got fds stdin 6, stdout 7, stderr 8
debug3: ssh_msg_send: type 2
debug2: fd 5 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: muxserver_accept_control: channel_new: 0
debug2: channel 0: send open
debug3: Wrote 64 bytes for a total of 2679
debug2: callback start
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_CTYPE = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: Wrote 192 bytes for a total of 2871
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
debug2: channel 0: rcvd ext data 20
debug2: channel 0: written 20 to efd 8
2
  • Do you have more output, by running ssh with -v ?
    – slubman
    May 6, 2011 at 13:01
  • I've added the relevant output above.
    – regularfry
    May 8, 2011 at 9:36

1 Answer 1

1

Your exact example works just fine with server OpenSSH_5.5p1 Debian-4 and client OpenSSH_5.8p1 Debian-4. So I would suggest upgrading your client if possible.

Edit: It also works reversing client and server (I actually created a redirection loop this way), so it may be enough to go up to 5.5p1 on the client.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .