To permanently enable ssh for a headless setup, my understanding is that the simplest method is to create an empty file /boot/ssh on the boot partition. However, when I write to a file using this pathname, the change doesn't persist after I reboot. If I'm understanding correctly, then this is because I'm not actually accessing the boot partition, and I need to mount that somehow. How do I do that? I'm running Raspbian on a pi-zero, installed from NOOBS.
Asked
Active
Viewed 764 times
2
-
1Have you tested that the ssh server is not now always started after a reboot? – GramThanos Jun 24 '19 at 00:55
-
@GramThanos: What I meant was that the file no longer exists after a reboot. – Jun 24 '19 at 01:07
-
I know, it is normal. – GramThanos Jun 24 '19 at 01:18
2 Answers
2
From the raspberry pi ssh documentation page (here)
When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled and the file is deleted.
Don't forget to change the default password.

GramThanos
- 481
- 3
- 11
-
-
-
Thanks. What I'm trying to ask is, if I then reboot a second time, with the file no longer existing, will ssh still be enabled? – Jun 24 '19 at 01:42
-
1Yes. You created the ssh file inside the boot partition, the raspberry saw it and deleted it, it set the ssh service to start on boot, and now ssh server will start every time automatically. – GramThanos Jun 24 '19 at 01:47
-
So you may now, change the default pi password and set a static ip to your raspberry (if you want) :P – GramThanos Jun 24 '19 at 01:48
0
You NEED a keyboard and display to setup NOOBS so the solution to enable ssh
on a headless system is superfluous.
This CANNOT be done on NOOBS, until Raspbian is installed (because the boot partition does not exist).
Just enable ssh
through raspi-config
(or the GUI equivalent).

Milliways
- 59,890
- 31
- 101
- 209
-
I have a keyboard and display. I'm setting the pi up initially using them, so that I can run it headless later. – Jun 24 '19 at 03:43
-
1If you want to run headless DO NOT use NOOBS (which wastes 1.3GB of your SD Card) and is only useful for multi-boot. Install Raspbian! – Milliways Jun 24 '19 at 03:49