Home Raspberry Pi Enable Raspberry Pi Zero SSH over USB

Enable Raspberry Pi Zero SSH over USB

The quickest and easiest way to use the Raspberry Zero as headless client

Raspberry Pi Zero and Raspberry Pi Zero W are great boards for small projects.  There are a number of ways you can configure the network directly from a microSD card before you even boot your board for the first time, but Raspberry Pi Zero, in particular, can be hard to work with if you don’t have an ethernet adapter. Fortunately, you can use a USB port to connect to your board without a keyboard or a screen.

Enable Raspberry Pi Zero SSH over USB in 4 simple steps

You can make it this pretty as well – click on the picture!

You will need:

  • Raspberry Pi Zero or Raspberry Pi Zero W – (obviously)
  • Windows PC – with a Bonjour installed (it’s the first time I get to use this in my life – Linux people Avahi-Deamon will do it)
  • A USB cable
  • SD-card and a reader
  • Putty on Windows or terminal on Linux

Step 1

Download the Raspbian image – full release or Lite – it works with both versions. Install Bonjour on your computer (or Avahi).

Step 2

Install the Raspbian image on the SD-card, and open it on the PC. You will need to open 2 files.

  • config.txt
    Add the following (new line):  
    dtoverlay=dwc2
  • cmdline.txt
    Add the following text after rootwait (leave a space, keep all in a single line):  
    modules-load=dwc2,g_ether
  • SSH file
    Create an empty ssh file in the boot directory to enable SSH access.

You will need this to enable ssh access. This file has to be created each time until you allow the SSH access in the Raspberry Pi config.

Step 3

Put the card in, plug the USB to the socket marked USB not PWR IN and power it up. Wait about 1-2 min – don’t rush it the first time.

Step 4

Raspberry Pi Zero SSH USB

Open up Putty and connect to (make sure you have no other Raspberries connected via Ethernet – you will connect to these instead if you forget to power it off)

raspberrypi.local

Enter the Raspberry Pi credentials:

  • Login (default): pi
  • Password (default): raspberry

and… You know how to connect Raspberry Pi Zero, Raspberry Pi Zero W  SSH USB! Now that you have the access to to the Raspberry Pi Zero W, you can take a look at this guide to set up the network permanently.

Getting the Internet

Working with SSH over USB is fun, but it would be great to have an internet connection too, especially on a Raspberry Pi Zero which has no internet adapters. You can simply share the existing Internet connection from your computer.

Navigate to the Windows Network connection tab. You will see your active internet connection and the Rasberry Pi Zero listed as “USB Ethernet/RNDIS” Make a note of the connection name (Raspberry Pi Zero).

Select the active internet connection and use Right Click to access the properties. In the Share tab, share this network connection with… you guessed it the “USB Ethernet/RNDIS” device. Reboot your Raspberry Pi and enjoy the internet connectivity.

You are welcome!

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency

SATA HAT

Add an SSD to Raspberry Pi 4 and turn it into a super-cooled NAS drive.

More HATs

Argon One

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO

More cases on

Best Raspberry Pi Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

Free wireless doorbell (Amazon Dash button hack)

0
The most terrifying situation I can imagine* is missing a parcel

Raspberry Pi NAS: (NAS-pi) Modding like a boss #part2

0
Plex and RAID1 NAS drive build log

MagPi – auto-downloader

0
Grab each edition of Mag Pi as soon as possible!

HOW TO...

How to boot Raspberry Pi 4 from USB

0
How to set up and boot Raspberry Pi 4 from USB drive - headless guide.

Raspberry Pi Zero, Raspberry Pi 3A+ WiFi without keyboard or cables

0
Getting Raspberry Pi boards connected in seconds

Everything you need to start using JSON

0
It's JSON not Jason, just saying!

How to use Join App in NodeRED

0
The day finally comes where Join app is almost everywhere!

Driving LCD with Arduino and Raspberry Pi

0
Displaying things on an LCD screen is as easy as going through a cup of jellybeans while writing this tutorial!