I used to be able to connect to my Pi over SSH but after an erase + reinstallation of Raspbian (after lost of pwd), I now get a port 22: connection refused.

I got latest Raspbian installed on the Pi (downloaded here and installed following these instructions).

I've checked this and this but I don't have any boot_enable_ssh.rc file on the boot partition and I'm not able to edit the ext3 partition (I'm using a Mac) so I can't perform Oli's solution.

I've also tried to Rename /etc/rc2.d/ssh/K??ssh to /etc/rc2.d/ssh/S02ssh but it didn't work.

Thusly :

  1. How can I check if SSH is indeed enabled on my Pi without any computer or keyboard ?
  2. And if it's not how to enable it ?

Btw, when doing a nmap, I've noticed that my Pi got a strange name l.home:

Nmap scan report for l.home (

Any help would be strongly appreciated !

  • What command are you using to connect? Are you using the IP or the name? How is the Pi connected to the network? Feb 29, 2016 at 1:40
  • @SteveRobillard : I'm using ssh pi@ The Pi is connected to the network via an Ethernet cable connected to the Router.
    – ldc
    Feb 29, 2016 at 14:30
  • can you ping that IP address? Feb 29, 2016 at 14:38
  • If your install is a fresh, official Raspbian, SSH is enabled by default.
    – Havnar
    Feb 29, 2016 at 15:14
  • That strange name looks as though there was a typo in the script command that set the name of the RPi. e.g echo 1 > /etc/hostname rather than echo $1 > /etc/hostname in a script where $1 was the first argument that was supplied on the command line of the script. Is your network supposed to be called home - if not, check /etc/networks...
    – SlySven
    Feb 29, 2016 at 15:40

1 Answer 1


I've finally done an ersatz of Oli's solution by :

  1. installing OSXFuse and fuse-ext2 to mount the ext3 partition.
  2. use the -o force option of fuse-ext2 in order to write on the ext3 partition.
  3. do the loop myself, i.e. rename each K**ssh in rc$i.d (for i=1 to 6) to S02ssh
  4. Reboot the Pi.

I'm not sure that enabling ssh on every runlevels is a very safe option but at least, it works that way. Anyway, this is strange that official Pi's documentation claims that SSH is enabled by default on Raspbian even though it seems that this is not the case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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