What is causing PuTTy to not connect to Raspberry Pi?
I have a Raspberry Pi, and I have an SD card with Rasbian on it that is currently in the Pi.
I have a laptop with Windows 8.1 on it, and I have connected it to the Pi using an Ethernet cable. I want to SSH in to the Pi, so I have installed PuTTy.
I went to the windows command line and typed in ipconfig and looked under Ethernet adapter Ethernet > Autoconfiguration Ipv4 Address to find the ip address of the Pi.
I took that IP and entered it under "Hostname(or IP address)" in PuTTy. I gave the name a session, pressed save and open. Now, I am getting the following error:
Fatal Error: Network Error: Connection RefusedI looked online, but I couldn't find a solution for windows (but there are a lot for Linux). I tried making sure I had the right IP address by trying to ping the Pi (and I can). I read other posts saying the error is caused by the server blocking the connection, but I am not sure how I would go about fixing that. The only thing I can see that looks strange in the command line to me is that there is no default gateway set up for Ethernet. However, I thought that I would need access to the Pi in order to change that.
Can someone tell me if there is a step I am missing in my setup that could be causing this error?
I'm new to this, so any help is appreciated. Thanks!
17 Answers
I came across this question while faced with the same error/problem. I've found something that works for me, so I'll update the answers.
The short answer is that you need to add a file to the boot folder of your SD card, and call it "ssh" (the filename is extension-less, mind you).
The instructions for this can be found here: Headless Raspberry Pi Setup
The Nov 2017 version of Rasbian already includes SSH server and client. However by default SSH is disabled. In order to enable it use
$ sudo raspi-config
Then choose "5. Interfacing options" Then select "Enable/Disable remote command line access to your Pi using SSH"
Tab to Back Tab to Finish
Now you should be able to SSH from your machine to your Rasbian Pi :)
0"Connection refused" generally means the sshd daemon isn't running, and/or isn't listening on port 22.
I think you might have the wrong IP: "ipconfig" on Windows gives you the Windows IP address: you want the Raspberry Pi address.
Try this:
raspi-config > 8 Advanced Options > A4 SSH > make sure SSH access is "enabled"
Run
ifconfigon the Raspberry Pi. Try Putty with that address.
Look here for more info:
9Mine was a case of an install of VirtualBox having the same IP addy as the rpi, on the windows host.
After looking at IPCONFIG on the windows host a dozen times, I finally noticed that it was the same for VB as the router had for my rpi.
Changed IP addy in VirtualBox > Preferences and was able to ssh on my second attempt (as is the custom with Putty on my box).
So if all the other troubleshooting steps don't work, looking for conflicts on the host is worth a shot. Don't ask how long it took me to figure this out -_-
TL;DR: When I typed XXX.XXX.X.10 for my IP in Putty, it was pointing to VirtualBox. IPCONFIG confirmed this. Changing VB IP address to XXX.XXX.X.100, solved problem.
Using 2018-11-13-raspbian-stretch-lite image doesn't works to setup "headless" raspbian, Using first 2018 raspbian-stretch-lite image works as it should.
IF YOU’RE USING A VERSION OF RASPBIAN RELEASED AFTER NOVEMBER 2016, THERE IS ONE EXTRA STEP. We have to enable ssh while writing the OS into the SD card. We have to add a file name SSH in the root directory as explained in the link below
1Try typing sudo raspi-config, then go to interfaces and enable ssh. I had the same problem until I enabled ssh in interfaces. Hope this helps :)
More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"