Recently I purchased a new pi, and didn't have a monitor to set it up with so I SSH'd into it using an ethernet cable. I did this 100+ times and randomly it stopped working, and now gives a "connection refused" error every time I try to SSH in.

I have tried reinstalling the OS and putting the SSH file in the boot directory. The SSH file gets deleted but still does not allow me to ssh in.

Any help would be greatly appreciated, thanks!

  • how are you connecting to the pi? ip address? or raspberrypi.local? or something else? I gather it's an ethernet connection? Jan 7, 2019 at 9:21
  • @JaromandaX I've been using raspberrypi.mshome.net, and yes it's an ethernet connection.
    – ENVY
    Jan 7, 2019 at 11:34
  • Please edit your question and add the output from ssh -v raspberrypi.mshome.net to it.
    – Ingo
    Jan 7, 2019 at 15:56
  • 1
    Connection refused means one of two things: 1. wrong ip address or 2. right ip address, wrong port. Try pulling the power, rebooting then looking at your home LAN router's config pages to see what address has been assigned to your RPi. If you have a cell phone connected to the same LAN install Fing fing.io and use that to scan your network. Fing will also scan devices to see what ports are open.
    – Dougie
    Jan 7, 2019 at 17:31
  • @Dougie Actually, IP address and port can both be wrong :) Jan 9, 2019 at 14:30

1 Answer 1


In Raspbian, by default, sshd is disabled - you can enable it using raspi-config. That would explain why you can't connect after installing new image.

Question is why it stopped working on old one. Most probable answer is that you did something so it stopped working.

Best way to configure remote access in home environment is to log in to freshly installed Raspbian via console (connected monitor/keyboard) and:

  • configure networking
  • note down MAC addresses (ip link list)
  • add static entry in DHCP server configuration on your home gateway so RaspberryPi always gets the same address.
  • OP cannot do anything you suggested. He has no monitor.
    – Ingo
    Jan 10, 2019 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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