I’ve only just learned this little trick, which is quite poor considering how long I’ve been using Pis. If you only need SSH access to a Pi and don’t want the hassle of plugging in a monitor and keyboard just to turn on SSH, you can do it by simply placing a file onto the boot parition…
/boot/ssh
The file should be empty, but must be named ‘ssh’ and be in the boot partition of the Pi’s card… which of course is formatted FAT32 and can be written to using a normal PC. So once you’ve used a disk imaging tool to write a Raspbian image to a new SD card, use the touch command or similar to ensure the ssh file exists, before you put the card into the Pi. On first boot, the Pi will resize its partition as normal, but after that it will enable SSH.
Word of warning: it’ll enable SSH with the default password for the pi user (raspberry), which is known to pretty much everyone. So the first thing you should do is log in and change it. Perhaps even regenerate the SSH keys just to be extra safe.