ramblam
Posts: 3
Joined: Sat Jul 02, 2016 10:23 pm

Can't SSH into my RPI3 anymore

Wed Aug 17, 2016 6:42 pm

Hello

So I’ve got a problem. I have a RPI3 and I had installed the Raspbian on a SD card, managed to update everything ( I use the RPI3 headless, using ubuntu to SSH into it and do my thingies…)
But since a while, I can’t seem to SSH into the machine anymore...first I thought that the IP has changed, but then I checked the machines connected on the network, it definetly states the same IP and even has raspberry pi attached to the IP…
So, I don’t remember exactly how I SSH’ed into it before, but trying now with terminal

ssh pi@<PI’s IP adress>

I get :
ssh: connect to host <your PI’s IP adress here> port 22: No route to host

First I thought that my firewall wasn’t letting me into the RPI, so I disabled it, rebooted everything, tried to SSHagain, this time I get this :

connect to host <your PI’s IP adress here> port 22: Connection refused

I don’t remember, before I try to SSH into the RPI, do I have to do something with PUTTY for that?
I also tried to use putty to SSH into the machine and there also it refuses the connection at the port 22, tried to change the port to 21, but then nothing happened...that is because I am also a noob in this and learning on the go...so which other ports can I try to use?

Then I thought, hey, the RPI doesn’t have a system on its own, why don’t I just prepare another SD card, this time with a rapbian lite, because I’ve read somewhere that it’s enough for a headless setup…
I even Edited the /etc/wpa_supplicant/wpa_supplicant.conf with

network={
ssid="my network_SSID"
psk="my network_PASSWORD"
}

but I still get the same results on the terminal as before...

the network on the PI is up, because my router sees it (I actually have to go to the internet site of my provider to check out the machines connected on the router, the usual 192.168.0..doesn’t work anymore, kinda creepy)
By the way, is there a way for us Linux users to bypass that Orwellian internet provider’s setup, a way to check the IP’s of the machines from the terminal?

What can I do please?

tenochtitlanuk
Posts: 156
Joined: Fri Jul 06, 2012 8:51 pm
Location: Taunton, Somerset, UK
Contact: Website

Re: Can't SSH into my RPI3 anymore

Thu Aug 18, 2016 7:10 am

I've been ssh-ing into my various Pi's for three years with no problems, but recently had a very similar problem.
It seems I'd confused the router by swapping rapidly between several pi's and different cards successively sometimes in one and sometimes the other, and even tho' I used correct address it refused connection. When I pinged, the first one went to the correct address, but it then sent further pings to the client machine I was working from.
I've done this kind of thing ( rapid changes of setup) before and not had this trouble- but I changed router quite recently, so perhaps this ( BT) one behaves differently.
Luckily it resolved after I switched off client, Pi and router and allowed the system time to re-set.

ramblam
Posts: 3
Joined: Sat Jul 02, 2016 10:23 pm

Re: Can't SSH into my RPI3 anymore

Thu Aug 18, 2016 9:02 pm

I turned off the router and the RPI, let them cool down for about ten minutes, tried it again, sadly got the same results: connection to port 22 refused
So how can I reset it? And if I go someplace where there’s a new router, would that make it work, or is the problem coming from the RPI?
How come when I change the SD to another distro, it still gives me the connection refused?
I just reset the router and still no change...I willtry to plug the RPI directry in the router.
when I ping to the adress it's sending me something back from the same adress, but ssh, nothing...is it possible to use another port than the 22? if so, then how?
That leads me to my next question : how can I use the RPI without a router, I mean it has wifi on its own, so it could act as an internal server, for like music and movies, without a router?

And what is the diference between ipv4 and ipv6 IP adresses?

Also, when I change my spot and have a new wifi router, I just have to edit the / etc/wpa_supplicant/wpa_supplicant.conf on the RPI with the new wifi info, right?


Thank you very much for your help

hal8000
Posts: 187
Joined: Fri Oct 04, 2013 5:22 pm

Re: Can't SSH into my RPI3 anymore

Sun Aug 21, 2016 6:26 pm

The problem with DHCP is that if you frequently disconnect and reconnect devices to your network they will
get assigned a different IP address. If you're trying to use SSH its like trying to hit a moving target,

First thing to do is configure your router to the DHCP pool has a fixed number of DHCP addresses and the
others can be used for static devices on your same home networl. Here's a link for Linksys:
http://www.linksys.com/us/support-artic ... Num=135673

Very similar on other routers, just use google if you need more help. Suppose you have your router
configured to use a DHCP LAN pool from 192.168.1.64 and your router gateway is at 192.168.1.1
This gives you 62 static IP address to assign for devices like RPi's network storage etc. Any device
that uses DHCP will be handed out an address that starts 192.168.1.64 upwards, so you'll have no address
cconflicts.

Now you need to configure your raspberry Pi to used a fixed IP address on wifi. Theres plenty of links on google
about this as well.

As for the SSH issue, you need to know the current IP address of your Pi and make sure it is pingable. Then
from Ubuntu (not windows or putty) you need to increase the verbosity. From the terminal type

Code: Select all

ssh -vvvv pi@192.168.1.2  (replace with correct IP address)
Thats 4 lower case v's. he terminal will give you about 2 screens output and copy and paste this output with
your next post. If any of the login details, have changed, or the port or a firewall has been added this can
create a no route to host.

Return to “Troubleshooting”