1

It's getting hard if you always plug HDMI cable to the raspberry pi, login and then turn the SSH service on with raspi-conf or other configurations methods.

Is there any way to turn the SSH service of a raspberry pi on after writing an operating system .img file like Raspbian to the SD-Card?

M. Rostami
  • 4,235
  • 1
  • 15
  • 34
  • 1
    Possible duplicate of [SSH not working with fresh install](https://raspberrypi.stackexchange.com/questions/58478/ssh-not-working-with-fresh-install) – Ingo Oct 30 '19 at 16:45
  • I've searched a lot but I haven't found any question related to enabling SSH without a Screen with this solution. @Ingo – M. Rostami Oct 31 '19 at 06:44
  • Just put `enable SSH` into the search line on the top of this side and hit *enter*: https://raspberrypi.stackexchange.com/search?q=enable+SSH – Ingo Oct 31 '19 at 09:59

2 Answers2

4

It's simple. After you write an .img file to the SD-Card, you can find a boot partition.
You just need to add an empty file that is named ssh without any format extensions in this partition. After that, plug the SD-Card into the raspberry pi and turn it on.
With the DHCP server of your Access point or something like that, you can find the IP address of the raspberry pi and try to make an SSH connection.

First method: Using PuTTY on Windows.
Second method: Using ssh client command on Linux: ssh pi@192.168.1.1 (if the IP address is 192.168.1.1)

Note that, the default username of Raspbian is pi and the default password is raspberry.

M. Rostami
  • 4,235
  • 1
  • 15
  • 34
3

After you have imaged the card before you put it in your Raspberry Pi if you mount the filesystem you can create a file in the /boot folder named ssh and that will enable the SSH service upon first boot.

zzzirk
  • 131
  • 4