up one level
---

How to SSH into Raspberry Pi Including Overcoming Network error Connection refused Message

By author Morgan Jassen

Applies to:
• Dell XPS 15 9560 laptop [Windows 10 (Microsoft Windows Version 1803)]
• Raspberry Pi Model B+ [Raspberry PI Raspbian GNU/Linux 9 (stretch)]
• PuTTY Release 0.70


This post covers how to SSH into Raspberry Pi, including overcoming a message like: "Network error: Connection refused".


1.)
First, we plug the Raspberry Pi device into power and into network. This Raspberry Pi device has just been flashed with a fresh image of Raspbian Linux OS. (I.e. using: https://www.raspberrypi.org/documentation/installation/installing-images/

Screenshot:




2.)
Next, we launch PuTTY and tell it to connect to what we know to be the Raspberry Pi's IP address (10.0.0.19 in our case)

Screenshot:



3.)
哦!Oh! PuTTY gives a message like: "PuTTY Fatal Error ... ❌ Network error: Connection refused ... OK"

Screenshot:



4.)
Next, we try to ping the device, as a sanity check. Hmmm... we can ping the device at that IP. Thus it's something else -- possible SSH is blocked or disabled. 

Screenshot:



5.)
Next we research and find that on fresh Raspbian config, ssh is disabled by default, but that writing a file with the name of "ssh" onto the boot partition will tell cause the device to become booted with ssh enabled upon the next boot. (See https://www.raspberrypi.org/documentation/remote-access/ssh/) So that's what we do.

Screenshot:



6.)
Next, we try connecting to the Pi via PuTTY (again, as in step "2.)" above). This time we see a different message like "...If you trust this host, hit Yes to add the key to PuTTY's cache and carry on connecting. ..." Woo hoo! looks like we got to the next step and will be prompted to log in!

Screenshot:



7.)
Next, we are indeed prompted to log in as "pi@10.0.0.19" which is expected in this case. We enter the default password ("raspberry" in this case) and we see the '...pi@raspberypi:~ $ ...' prompt. We're in!

Screenshot:



In conclusion, this post has covered how to SSH into Raspberry Pi, including overcoming a message like: "Network error: Connection refused".



This blog post first published 2019-06-03 at https://wieldgadget.com/2019/2019-06-02-ssh-to-raspberry-pi

[2018-07-17 Note: This blog post was republished on 2018-07-17 at https://i̶n̶v̶e̶s̶t̶o̶r̶w̶o̶r̶k̶e̶r̶.̶c̶o̶m̶/2019/2019-06-02-ssh-to-raspberry-pi.html ]