2

Raspberry pi has been having some erratic ssh and vnc performance, it just closes itself and do not let me reconnect, I need to restart it in order to do so. I tried connecting from my external ip, as if I were away from home and it is working much better than if I ssh directly to it's ip. Any suggestions?

  • 1
    Have you checked the logs? I had some similar issues but at one point the problems where gone, don't ask me why. After restarting dropbear i could connect again. – ortang May 20 '13 at 19:53
  • You have bad cabling from your remote host or crappy wifi. The only reason you have better connection from internet is because the Pi is is directly wired to your modem most likely and then to the internet. Your home computers might be running on flakey Wifi that causes SSH to panic and drop connections, a bad cable that just causes too many errors for SSH. SSH is very sensitive on junk because it anticipates man in the middle attacks. You might "think" your LAN is OK because it runs fast enough (but not reliably enough) – Piotr Kula Sep 5 '13 at 10:00
1

A few things you can check:

You don't say what OS you are connecting from, but I have successfully SSH'ed from Mac OSX and Windows and even my iOS iPad. Mac OSX was the easiest, since I just used the Terminal app. I'd imagine any Linux would be as easy as the Mac. Reason the Mac was so easy is I didn't have any firewall on my Mac.

On Windows (7 and 2008 Server) I was initially caught out by firewall rules. So make sure your firewall allows Port 22 TCP access. Windows Firewall doesn't allow that by default and it's not so straightforward to enable it - but Google and you should be able to find out how to do it. This is most likely to be your root cause.

Next possibility is that you can't find your RPi from your other machine. Are you referring to it by its IP address? That should work (though I don't know if IPv6 will work, I've not used that). If your RPi has a DNS Name ago you're trying to connect to it by name, does the name actually resolve? Open up a CMD or Terminal window and type ping (where you'd replace the bit in brackets with your DNS name - like ping raspberry). If ping says it can't find your RPi then you need to figure out how to get a DNS name for your RPi - which is a whole new set of issues. In that case you're probably best going back to using IP address.

Last one I can think is that you have set up PuTTY to automatically log in but you haven't got the keys necessary for auto-login. I have set auto-login on my machines and it's not easy, but again there's quite a lot of info on Google.

The fact you can connect from an external machine indicates the obvious one isn't the case (that you have not got a running SSH daemon on your RPi!)

  • Its down to his network. Clearly he can connect from the internet so it does not matter what he is using. ITs a good answer but not really hitting the head on the nail here :( – Piotr Kula Sep 5 '13 at 10:02
1

I copy the same answer I gave to Why does my Pi become unreachable from other computers but is still connected to the internet? because you probably have the same problem:

It seems that some versions of the Raspberry Pi tend to hang on high network load.

I solved the problems I had with mine by updating the firmware and allocating more memory for the USB driver.

To update the firmware, use rpi-update:

sudo apt-get install rpi-update
sudo rpi-update

And to change the memory assigned to the USB driver, you should find this value in /etc/sysctl.conf:

vm.min_free_kbytes = 8192

And change it to 16384.

More info:

https://github.com/Hexxeh/rpi-update

http://elinux.org/R-Pi_Troubleshooting#Crashes_occur_with_high_network_load

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.