I have a Raspberry Pi 1 Model A running an image of Raspbian Stretch Lite.

I've noticed that when I power on my pi and allow it to start up, I can't seem to SSH into it from my Mac laptop. First, I have to hook my RPi up to a keyboard and monitor, log into it (with the default pi user, which is fine for now), and then effectively "bounce" SSH manually:

sudo service ssh stop
sudo service ssh start

Once I do this, I can then SSH into the RPi (from my Mac) without any problems.

I believe this means SSH is not running by default at startup. How can I confirm this is the case, and how can I fix it so that I can have the following dev/test cycle:

  1. Power on the pi
  2. Give it a minute or two to boot up
  3. SSH into it from my Mac

Any ideas?


3 Answers 3


The easiest way to do this for a headless setup is to create a file named ssh on the boot partition of the SD card. This will enable the SSH daemon immediately after first boot and will be deleted.

Official SSH guide: https://www.raspberrypi.org/documentation/remote-access/ssh/README.md#3-enable-ssh-on-a-headless-raspberry-pi-add-file-to-sd-card-on-another-machine

This and more for the headless setup can also be found on the Raspberry Pi forum: https://www.raspberrypi.org/forums/viewtopic.php?t=191252

  • 1
    I just confirmed that this procedure works as expected on the RPi A using a fresh raspbian stretch install.
    – bobstro
    Sep 29, 2017 at 21:33
  • 4
    Does NOT work on November raspbian stretch
    – decades
    Jan 25, 2018 at 15:18
  • 1
    The documentation says this in this link raspberrypi.org/documentation/remote-access/ssh/README.md Mar 25, 2018 at 22:58
  • I just confirmed this procedure on my Linux PC where I had the microsd card mounted under /media/fred. I issued the commands: cd /media/fred/boot then touch ssh Then I unmounted the microsd card, removed it from my PC and then inserted it into my Raspberry Pi and booted the Pi. I could then ssh to the Pi from my Linux PC. e.g. ssh [email protected]. This is on raspbian stretch lite on a Raspberry Pi 3B.
    – Will
    Mar 3, 2019 at 7:55

Have you created a file in the /Boot directory called "ssh" with no extension?

or setting from

sudo raspi-config 

then -> interfacing options -> enable ssh

EDIT enter image description here

  • Thanks @Dr.Rabbit (+1) - but two concerns: (1) I have alreadymanually provisioned certain parts of my Raspbian distribution (installed Java, deployed certain apps/files to particular locations on the file system, used systemd to create/manage certain services for me, etc.)...will running sudo rasp-config undo any of the settings I've already configured manually? In other words: does it "wipe the slate clean" so to speak? And (2) according to this link there is no "Interfacing Options" menu off of the raspi-config main menu, any thoughts?
    – smeeb
    Sep 29, 2017 at 11:37
  • No it doesnt touch any settings you dont, think of it like a bios screen
    – Dr.Rabbit
    Sep 29, 2017 at 11:40
  • Ahhh you're talking about a PiZero, I have a 1 Model A, I don't think my version works the same as yours.
    – smeeb
    Sep 29, 2017 at 11:51
  • Oh im sorry I thought they all ran the same config app, any creating the file manually should solve it
    – Dr.Rabbit
    Sep 29, 2017 at 12:02
  • They do all run the same config app. It's part of the OS, which is the same for all models.
    – goldilocks
    Oct 4, 2017 at 19:48

Issue the two command as superuser

systemctl enable ssh.service
systemctl start ssh.service

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.