1

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 Refused

I 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!

1
  • @MartinPrikryl I flagged it so that way it could be migrated to Super User. Thanks! – JustBlossom Jun 5 '15 at 14:48
4

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

4

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
3

"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:

  1. raspi-config > 8 Advanced Options > A4 SSH > make sure SSH access is "enabled"

  2. Run ifconfig on the Raspberry Pi. Try Putty with that address.

Look here for more info:

http://www.instructables.com/id/Use-ssh-to-talk-with-your-Raspberry-Pi/

9
  • Where would I find that if I haven't gotten into the Pi yet? I read through the documentation, but I don't have access to an external screen and keyboard to get into the log in screen for the Pi. – JustBlossom Jun 4 '15 at 18:18
  • OK: exactly how far do you get with this tutorial: raspberrypi.org/help/quick-start-guide – paulsm4 Jun 4 '15 at 18:42
  • I made it through step one, but I didn't make it any further because the rest requires a keyboard and screen. I followed the noobs guide in step 7 of the guide you sent: raspberrypi.org/help/noobs-setup I got to step two of "First Boot" but I never saw anything boot. I even tried restarting my computer to see if it would do something like a dual boot that I would do with Ubuntu. So, that is when I broke away from those instructions and started trying to SSH into it since I don't have an external keyboard or screen. – JustBlossom Jun 4 '15 at 19:12
  • 2
    To summarize: 1) the reason you're getting "connection refused" is because you're pointing to the wrong IP. You need to "Putty" in to your Raspberry Pi: you can get the IP from "ifconfig" (at an RP command prompt), or from the boot screen. You might also need to run "raspi-config" (from an RP command prompt) to get sshd working. 2) Even though you can run RP "headless" after you've configured it ... you're probably going to need to connect a monitor and keyboard in order to configure it. – paulsm4 Jun 4 '15 at 22:33
  • 1
    Just in case anyone reading this thread is wondering...I ended up just getting a screen and keyboard to finish the configuration. – JustBlossom Nov 9 '15 at 3:41
0

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

0

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.

-1

Try 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 :)

-1

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

https://www.circuitbasics.com/raspberry-pi-basics-setup-without-monitor-keyboard-headless-mode/

1
  • Link only answers are inappropriate and unhelpful. Please consider editing your answer so it answers the author’s question – Ramhound Jun 5 '20 at 23:20

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