Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
sshd crashes when accessing forwarded ports #288
I'm attempting to run openssh in a windows 10 machine. I think everything is set up correctly, I'm able to connect fine with passwords/keys etc.
I'm attempting to forward a port over the connection (via putty), as soon as something at the client end attempts to access the forwarded port the connection is aborted. If I run with sshd.exe -d, then launch something accessing the remote port, the windows crash dialog displays with "sshd.exe has stopped working" and the following output displayed:
debug1: server_input_channel_open: ctype direct-tcpip rchan 257 win 16384 max 16384
Not really sure what I'm doing here, if there is additional info I can supply to help identify the problem please let me know.
I am also experiencing this same problem, although I don't believe sshd is actually crashing (as in the bug title)... just that the client is abruptly disconnected.
I am attempting to connect to a VNC server over an SSH tunnel. Standard procedure is to establish SSH client connection to server with port forwarding, then connect VNC client to localhost:port. Just as adverst noted above, SSH connects fine and shell commands work as expected. As soon as I attempt to connect VNC, the SSH connection is disconnected.
Running Win32-OpenSSH v0.0.5.0 on Windows 10 Pro with TightVNC Server v.2.8.5. (FYI: IPv6 is disabled.)
I have reproduced this on Ubuntu 16.04.1 LTS with OpenSSH_7.2p2 client and Remmina v1.1.2 (VNC client), and also on Android 7.1.1 (Nexus 6P phone) with ConnectBot v1.8.6 and Real VNC Viewer v3.0.0.024226.
From Ubuntu (same error):
I'm not the original submitter, so I can't re-open..... but I've duplicated this issue on a clean install of 0.0.7.0. Log shows exactly the same as my post above.
Additionally, since I didn't put this in my previous post, here is the output to ssh-agent.log:
6780 00:04:31 671 client pid 10236 connected
After some more testing, it appears the issue may be related to ipv6.
As I noted in my post from December 30, 2016, ipv6 is disabled on all interfaces on all systems and devices in my environment.
Looking at the SSHD logs, I noticed problems arise as soon as local port forwarding is initiated for the ipv6 localhost ("[::1]:5900") with getsockopt errors. In sshd_config, the default argument for keyword
What I don't know, however, is if sshd is exhibiting this problem on interfaces and/or environments with active ipv6 configurations (or, at the very least, not completely disabled ipv6). Unfortunately I am not able to personally test that setup, so perhaps someone else can create and test that environment.
Here are the pertinent parts of the logs to compare:
560 18:07:06 206 Starting session: shell on console for bdr2 from 192.168.1.10 port 43562 id 0
7208 21:06:18 366 Starting session: shell on console for bdr2 from 192.168.1.10 port 43976 id 0
I'm sorry for the massive wall of text there, but I'm a bit out of my depth and have no idea what may or may not be relevant so I'm just attaching everything I can see.
I'm seeing this problem even with IPv4 set explicitly in the config file. IPv6 is explicitly disabled on the network adaptors of both the client and the server in this case - although the exact same thing happens if I re-enable it.
Here's the content of sshd_config
If I start sshd -ddd for debugging and connect as normal, everything initially seems fine:
and this from the server:
However as soon as I attempt to connect to the tunneled port (in this case TightVNC Server on 5899, tunnel established from 15899 on the remote host) It spams
approximately 1800 times into the client console before suddenly disconnecting with:
It then repeats
with various rcvd adjust values around the 8200 mark.
At the server end the sshd.exe process dies hard, throwing a standard "OpenSSH for Windows has stopped working" popup, along with this corresponding message in the Application log (via event viewer)
There is no corresponding line in sshd\logs\sshd.log
@bdr2 - Can you try with the latest version (0.0.14.0).. It works for me with (AddressFamily inet and AddressFamily any)..
@theJT - I tried on my local machine with the tightvnc... both the local port forwarding, remote port forwarding works well and I can do the vnc as well...
To debug further I need more information,
You can revert this back using
I've finally traced this to an issue with TightVNC server itself. When set to listen to loopback connections it gets weirdly specific. a tunnel of 15900:$HOSTNAME:5900 (as in my ssh script, where obviously $HOSTNAME is being populated with the target machine's name) will not work, but 15900:127.0.0.1:5900 will.
Thank you all for your help.