HomeRaspberry PiEnable 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 with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

M5Paper

Programable, ESP32 based awesome dev platform with 4.7 e-ink display by M5Stack

More HATs

client-image
client-image

Argon One M.2

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO and M.2 SSD support

More cases on

client-image
client-image

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.

Slow Internet Warning

0
From time to time my Internet grinds to a stop. Since Raspberry Pi 4 comes with a 1Gbps Ethernet, I decided to take advantage of it and create a reporting system in NodeRED that will monitor and report when the ISP is not keeping the contractual agreements. Works with Alexa, Google Home, Android and Windows 10.

How fast Raspberry Pi NAS is?

0
Let's see how fast Raspberry Pi NAS really is?

Argon18: Argon ONE SSD modification

0
Argon One case just got better - now you can boot it from USB without ruining the design thanks to Argon 18: Argon One SSD modification

HOW TO...

How to boot Raspberry Pi 5 from NVMe M.2 SSD

0
This is how you can boot your Raspberry PI 5 from NVMe in 10 min! Check out these easy instructions

It took me 2 months to boot CM4 from NVMe

0
Complete beginners guide to Compute Module 4 boot from NVMe.

Raspberry Pi Zero 2 W vs other Zero boards

0
It's time to test the Raspberry Pi Zero 2 W against other Raspberry Pi boards from Zero series: power, WiFi, temperature and core performance

C/C++ and MicroPython SDK for Raspberry Pi Pico on Windows

0
A guide to SDK toolchain for Raspberry Pi Pico and C/C++ , Micropython on Windows.

A comprehensive guide to Grafana & InfluxDB

0
How to use Grafana and InfluxDB on Raspberry Pi for IoT sensors in home automation