Page 1 of 1

Remote SSH my RPI (non local)

Posted: Friday 17 February 2017 10:13
by DewGew
I want to be able to access my Pi anywhere (outside a local network) via ssh. Its not working with any android app like JuiceSSH localy on my phone either.
It works fine on local network with my desktop (putty or winspc).
When I connect via ssh over internet I can login with username and password but then nothing happens I get connection timeout.

I have:
[*]i use rpi wifi dongle not ethernet cable
[*] public ipadress is static from my ISP
[*] set my RPI with static ipadress. (also reserved same ipadress in my router)
[*] open port 22 in my router ( Netgear wnr1000v3)

Any Ideas that might help?

Re: Remote SSH my RPI (non local)

Posted: Friday 17 February 2017 21:13
by shaneben
Have you looked at Port Forwarding? The static IP on your local network will be different than the outward facing IP. You will need to tell the router where to point port 22 at on the internal network.

So if RPI is at 192.168.1.30 you would set the port forwarding on the router to have port 22 forward to 192.168.1.30.

Re: Remote SSH my RPI (non local)

Posted: Friday 17 February 2017 21:42
by SweetPants
shaneben wrote:So if RPI is at 192.168.1.30 you would set the port forwarding on the router to have port 22 forward to 192.168.1.30.
Don't use standard port numbers like 22 for SSH but use port translation like 2222 -> 22. Standard ports are likeley to be used first when somebody tries to hack into your network. If you are using Linux, also install fail2ban for SSH (google for it)

Re: Remote SSH my RPI (non local)

Posted: Friday 17 February 2017 22:35
by shaneben
SweetPants wrote: Don't use standard port numbers like 22 for SSH but use port translation like 2222 -> 22. Standard ports are likeley to be used first when somebody tries to hack into your network. If you are using Linux, also install fail2ban for SSH (google for it)
Great advice also look into disabling the user/pass login and use SSH Keys instead.

Re: Remote SSH my RPI (non local)

Posted: Friday 24 February 2017 10:26
by DewGew
SweetPants wrote:
shaneben wrote:So if RPI is at 192.168.1.30 you would set the port forwarding on the router to have port 22 forward to 192.168.1.30.
Don't use standard port numbers like 22 for SSH but use port translation like 2222 -> 22. Standard ports are likeley to be used first when somebody tries to hack into your network. If you are using Linux, also install fail2ban for SSH (google for it)
I don't use standard port and i forward the ip in my router. I found the problem. I can“t connect remotely with wifi on my rpi. I change to LAN and
now it works.

//DewGew

Re: Remote SSH my RPI (non local)

Posted: Friday 24 February 2017 11:06
by Holland
Best to start a VPN session, e.g OpenVPN, and then you can do anything you want on your network. Works perfect in my case.

Re: Remote SSH my RPI (non local)

Posted: Sunday 26 February 2017 15:40
by CalimeroInc
I had a similar problem with my Raspberry. SSH worked fine when it was connected via LAN, but hanged when I tried to login via Wifi.

Found the solution here: https://expresshosting.net/ssh-hanging-authentication/

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).