Raspberry Pi: Enable SSH Headless

As tinker with my Raspberry Pi 4, there's are many things I'm learning from this device. Especially when trying to complete simple projects.

At the moment, I'm trying to set up PiHole and a NextCloud server.

Let me kick off this post with how to enable SSH without connecting a keyboard, mouse or monitor to you Raspberry Pi...AKA Headless.

So the simple way to explain how to do it, is to drop a empty text file (with no extension) in the boot sector named SSH. That's it. I can see myself do this in Windows without issue, but here, I'm going to post post how to do this on MacOS. Here we go.

Enable SSH on Raspberry Pi in Headless Mode

To enable SSH on Raspberry Pi in headless mode, follow these steps:

1. Make sure you properly installed Raspbian on your Raspberry Pi microSD card. If you have already done so, turn off the device and remove the card.

2. Put the microSD card in the card reader of your computer. Wait until the card mounts. You may need to use a microSD to SD card adapter. All recent Raspberry Pi versions use microSD instead of standard-size SD cards.

3. Navigate to the boot folder. This is the root folder of your SD card. Boot is the default volume name when you install a Raspbian system on an SD card. If you are on a Windows machine, use any file manager, such as Explorer. On macOS or Linux, open a terminal window and type:
cd /Volumes/boot

Note that the name of your SD card can be something other than “boot”. If it is, open the root volume folder and proceed with the next steps.

4. In the boot volume, create a file without an extension and name it ssh.

On Windows, right-click anywhere in the boot volume’s white space and select New > Text Document. Delete the .txt extension before you hit Enter. If Windows Explorer on your computer does not show file extensions, click View and enable File name extensions in the menu bar.
    • Windows explorer enabling file extensions view menu.

On Mac or Linux, run the touch command while in the boot directory to create a blank ssh file:
touch shh

5. Safely remove or eject the card from the computer and insert it again in your Raspberry Pi.

6. Boot up Raspberry Pi.

Every time you turn on the Pi board, the device looks for the ssh file. When the device finds the file, then SSH is enabled automatically. If you correctly created an empty ssh file without an extension, you can now SSH into your device.

Follow Me:
YouTube: http://www.youtube.com/TheTechLoft
Instagram: http://www.instagram.com/salciampa
RSS: http://feeds.feedburner.com/SimpleNecessities