2

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.

2 Answers2

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
  • I see...so is the effect permanent, even though the file gets deleted? –  Jun 24 '19 at 01:32
  • The file is just an easy way to set the ssh server to auto start. – GramThanos Jun 24 '19 at 01:38
  • 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
  • 1
    Yes. 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
  • 1
    If 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