Enable SSH in Raspbian/Ubuntu without Keyboard & Monitor

Many times, a situation arises for an IOT developer where he/she wants to ssh onto a newly flashed raspberry pi running on Ubuntu/Raspbain but without a Monitor and keyboard or any other input device.


The first and foremost thing to SSH into a pi is to open port 22. But its always closed for security purposes. When we have a pi with a keyboard and monitor its easy to open the port but that isn’t the case always. Here we will explain how to open port 22 and enable ssh without any input device.

Open Port 22 in Raspbian/Ubuntu for SSH

Without wasting time we will straight tell you to steps to open port 22

  1. Prepare your sd card using Etcher and your OS image (or Mount flashed SD card)
  2. Navigate to the SD card [boot] using your OS file manager or terminal
  3. Create a new empty file named ssh, without any extension, inside the boot directory [touch /boot/ssh]
  4. Remove the SD card from your computer and put it in your Raspberry Pi.
  5. Power on your Pi board. On boot Pi will check whether this file exists and if it does, SSH will be enabled and the file is removed.

That’s it, now connect your raspberry pi to your network via LAN, find the IP address from your Router’s console and ssh onto it. If you want to SSH to your Pi from a different network – Click Here.

Leave a Reply

Your email address will not be published. Required fields are marked *