Enable ssh on a headless Raspberry Pi
Since version 2016-11-25 of Raspbian the ssh daemon is disabled by default (see the Raspbian release notes). But the Raspbian documentation on ssh describes a way how you can enable it again. You can do that before you even copy the image to an SD card and boot for the first time. This comes in handy especially when you run your Raspberry Pi without a monitor or keyboard attached (headless).
Here is what you need to do:
- download the latest Raspbian image, e.g. 2017-02-16-raspbian-jessie-lite.img
- examine the image using fdisk
- in order to mount the boot partition we need to know its start offset in bytes, in our case that would be 512 * 8192 = 4194304
- create a temporary folder to mount Raspbian’s boot partition
- mount Raspbian’s boot partition
- create ssh file to tell Raspbian to enable the ssh daemon by default
- unmount the partition again
- copy the image file to an SD card
- boot your Raspberry Pi, the ssh daemon should be enabled by default