/SSH Hangs during authentication on Raspberry Pi

SSH Hangs during authentication on Raspberry Pi

Reading Time: 1 minute

Recently I attached a Raspberry Pi zero to my bathroom fan to regulate it depending on the humidity. I used to have one of those fancy automatic fans, but it only kicked in when I was out of the shower or turned on randomly in the middle of the night.

While I was programming the device I ran into a rather strange problem. When connecting to the raspberry pi via SSH it asked me for my username and password, after entering the password and pressing enter, nothing happened. The SSH session simply hangs, I tried using my phone to start a session, but it did the same. Tried rebooting the device, resetting the wireless AP, but nothing helped.

After some searching online I found out that recent versions of Raspbian use QoS, and this can sometimes cause issues when using SSH over WiFi. Luckily there is a solution for this problem.

The fix

I pulled the SD card from the RPI and put it in card reader which I connected to my Linux box. There I edited the following files:

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

At the end of these files I added the following line:

IPQoS 0x00

After putting the sd card back in the device and booting it I was able to access SSH again.