You can open the boot partition on the SD card (the FAT32 partition) and create an empty file named
ssh in the root directory of that partition. Ensure that the file is names
ssh and not
Don’t forget to unmount the boot drive before removing the SD card. Once you restart the Raspberry Pi with the modified SD card, SSH will be enabled without you having to attach a keyoard or screen to the Pi.
This approach was tested with the
2018-11-13 version of Raspbian and works with Raspberry Pi 1, Raspberry Pi 2 and Raspberry Pi 3.
Credits to Yahor for the original solution on StackOverflow!