I am having trouble accessing my Pi from the internet using SSH. I have been searching around a number of websites, seen similar but not exactly the same issues as mine so hope someone on here can help. First up, I am a relative novice when it comes to networking so have gone right back to the basics to try to set this up as I do not yet understand technical speak.
My pi is a fresh install of Raspbian. It was then apt-get “updated” and “upgraded” successfully, so I am assuming everything should be up to date. No additional software has been installed yet.
I did this “headless” using SSH over my local network. SSH seems to work fine on the local network inside my house.
I set the pi up with a static internal ip address on my BT router. Note: this router can not be set up to be “pinged” I don’t know if that matters but more on that in a moment.
Port forwarding has been enabled on the router for port 22 and set to point to the “raspberrypi”.
As a BT customer, I then popped outside and hooked onto a neighbour’s “fon” service and logged in using my Dell running Ubuntu 16.04. Did a test search on google to validate the connection was up.
I opened a terminal window and typed:
ssh [email protected]
The IP address used was that dynamic IP address provided by BT to my home network before I went outside (and it still was when I went back in). To be clear I did not type xxx
this was a three digit number.
I was not sure what my username was on the pi because it only ever asks for my password so I typed whoami
whilst using SSH with the Pi on my home network. The response was pi
.
Hence I thought it should work but it did not. After pressing return there was a long pause and then it timed out.
Suspecting the ping issue was the problem and that the BT Home Hub 3 modem was operating in some sort of stealth mode not readily apparent from searching the advanced settings, I bought a new ADSL router that can be pinged (I am serious about getting this working). It was an older model Belkin.
Setting up as before more or less (I seem unable to set a static ip internally for the pi with this modem but no matter for now, because it stays put at 192.168.2.3 when it is on) I was able to use SSH in the house with no problem. With ping on I went outside and tried again.
Ping worked
but ssh pi@ [correct public ip address for router at that time]
did not work
This time there was a much faster response – a one liner ending with “connection refused”
This was repeatable with ping on or off which is a relief because I’d rather it be off.
So 2 issues
- Why did I get two different results with different modems?
- How can I get it to work?
Apologies for the epic tale, but from what I have learnt so far, details can be very important.