1

I have both eth0 and wlan0 actives, can ping both, can run RDP to both IPs (192.168.0.101 for eth0, 192.168.0.102 for wlan0).

Ssh to eth0 works OK, ssh to wlan0 works OK as long as I have eth0 connected to the router. If I disconnect eth0 and run ssh (Putty, from windows) it hung after typing password. Wlan0 respond to ping, RDP works ok. :/

If I run a sudo service ssh status on my RPi I get that the session is opened.

Any suggestion?

/Alejandro

Alejandro
  • 11
  • 1
  • Interesting issue. Also have a look at the follow - https://raspberrypi.stackexchange.com/questions/12471/raspberry-pi-hangs-on-ssh-but-gives-feedback-from-a-telnet-terminal Have been having this issue for a while but never got around to the fix. Only just stumbled across the fix and it seems to work for me. – tangowhisky37 Jul 12 '17 at 07:47

2 Answers2

2

looks the DNS issue : after you're unplugging eth0 your OS still tries to use it's DNS servers, especially if you have a DHCP on eth0. Add/change in `/etc/ssh/sshd_config :

UseDNS no

and restart your system to take effect. Also it would be useful if you'll post your sshd_config

Alexey Vesnin
  • 926
  • 9
  • 16
1

You have eth0 and wlan0 both connected to the same router and both connections are working as you can see if you ping its ip addresses. But the kernel can only use one connection at a time if you use a stateful tcp connection. This is the case with ssh. It starts a password enabled authenticated session on one connection to its destination ip address, e.g. to 192.168.0.101 for eth0. This must be available as long as the session is established (until logoff). If you disconnect eth0 then ssh hangs. It will not switch to use 192.168.0.102 for wlan0. To achive this you have to use a connection with dynamic fail over.

Ingo
  • 42,107
  • 20
  • 85
  • 197