SSH Hangs After Authentication on Raspberry Pi 3

Posted by Tom Walsh | Comments Off on SSH Hangs After Authentication on Raspberry Pi 3

SSH Hanging when Connecting to Raspberry Pi 3

We recently encountered a rather odd problem with a new device we were testing. We had a Raspberry Pi 3 in the office and were doing some testing with the device. The Raspberry Pi 3 was completely up to date running the latest versions of the OS Raspbian (based off of Debian 8 – Jessie, OpenSSH 6.7p1).

What was happening is that we could connect to the Raspberry Pi 3 via SSH. We would be prompted for a username and password as usual, but then when we typed in the password nothing happened. So the SSH was hanging after we had authenticated. It just sat there and wouldn’t respond to any input at all. We had to close the session window.

After some investigation we have determined that this a combination of two issues. One the latest version of SSH installed on the Raspberry Pi 3 uses QoS headers to ensure speedy delivery of packets over the network. For interactive connections (standard shell SSH connections) it sets the IP header for IP_TOS to be 0x10 (low delay or latency). For non-interactive connections (scp, etc) it sets the IP header for IP_TOS to be 0x08 (max throughput).

The problem in our case seems to be that our network doesn’t really like those values. We aren’t sure if this issue is with the router itself, or something in between. Since this connection is occurring over WiFi and our router handles the Wifi, we suspect that the router is where the issue lies though.

Additionally, we were able to determine that this impacted both SSH and SSHd, so both incoming and outgoing SSH connections were impacted by this issue.

How To Fix SSH Hanging

We did determine a work around to get SSH to work though.

Edit the two configuration files for the Raspberry Pi:

/etc/ssh/ssh_config
/etc/ssh/sshd_config

And add the following line to the bottom of the configuration file:

IPQoS 0x00

And restart sshd (sudo service sshd restart).

This configuration change will modify the TOS value sent out by SSH and SSHd, and will no longer choke the network connection.

We hope that helps somebody out there. It was a bit of a pain to track down.

Special thanks to this page which helped us find the correct settings to set IPQoS to: https://github.com/catmaker/chippy/wiki/Ubilinux-Post-Installation

Comments are closed.

Get in Touch

Latest Posts

We’re now part of Total Server Solutions

Express Web Systems customers are in for a bit of an upgrade in service and technical capacity. ¬†If you‚…

Heading to cPanel Conference 2016

Hello Portland (Oregon)!

ExpressHosting is here at the 2016 cPanel Conference. We are excited to learn…