Raspberry Pi — SBC

Headless SSH Setup

Once your Pi is booted with SSH enabled (configured during flashing), connect to it from your laptop using SSH — no monitor or keyboard needed.


Prerequisites

  • Raspberry Pi flashed with OS and SSH enabled (Flashing Guide)
  • Pi powered on and connected to the same network as your laptop (via Wi-Fi or Ethernet)
  • About 2–3 minutes for the Pi to complete its first boot

Step 1 — Wait for the Pi to Boot

After powering on, the Pi needs 1–3 minutes for first boot (filesystem expansion, SSH key generation, applying your settings).

The Pi's green activity LED will blink rapidly during boot and then slow down or stop when it's idle and ready.


Step 2 — Find the Pi's IP Address

Method A: Use the Hostname (Easiest)

If you set a hostname during Imager configuration (e.g., raspberrypi), you can connect using:

text
raspberrypi.local

This uses mDNS (Bonjour/Avahi) to resolve the hostname on your local network.

mDNS on Windows

Windows 10/11 supports mDNS natively. If raspberrypi.local doesn't resolve, install Bonjour Print Services from Apple, or use the IP address method below.

Method B: Check Your Router

  1. Log in to your router's admin panel (usually at 192.168.1.1 or 192.168.0.1)
  2. Look for a device named raspberrypi (or your custom hostname) in the DHCP client list
  3. Note the IP address (e.g., 192.168.1.105)

Method C: Use a Network Scanner

On Ubuntu/macOS:

shell
# Install nmap if not installed
sudo apt install nmap    # Ubuntu
brew install nmap        # macOS

# Scan your local network (adjust subnet to match yours)
nmap -sn 192.168.1.0/24 | grep -i "raspberry\|raspberrypi"

On Windows (PowerShell):

powershell
# Ping the hostname
ping raspberrypi.local
# The response will show the IP address

Step 3 — Connect via SSH

Windows

Option A: Windows Terminal / PowerShell (Windows 10/11):

powershell
# Using hostname
ssh analog@raspberrypi.local

# Using IP address
ssh analog@192.168.1.105

Option B: PuTTY (GUI SSH client):

  1. Download PuTTY from putty.org
  2. Enter hostname: raspberrypi.local or the IP address
  3. Port: 22, Connection type: SSH
  4. Click Open
  5. Enter your username and password when prompted

Ubuntu / macOS

shell
# Using hostname
ssh analog@raspberrypi.local

# Using IP address
ssh analog@192.168.1.105

On first connection, you'll see:

text
The authenticity of host 'raspberrypi.local' can't be established.
ED25519 key fingerprint is SHA256:...
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

Type yes and press Enter. Enter your password when prompted.


Step 4 — Verify You're Connected

Once logged in, you should see the Pi's command prompt:

text
Linux raspberrypi 6.6.xx-v8+ #xxxx SMP PREEMPT ...

analog@raspberrypi:~$

Run a quick check:

shell
# Check OS version
cat /etc/os-release

# Check Pi model
cat /proc/device-tree/model

# Check network interface
ip addr show

Typing your password every time is tedious. Set up SSH key authentication for passwordless login.

On your laptop:

shell
# Generate an SSH key pair (if you don't have one)
ssh-keygen -t ed25519 -C "your_email@example.com"
# Press Enter to accept defaults, set a passphrase if desired

# Copy your public key to the Pi
ssh-copy-id analog@raspberrypi.local

On Windows:

powershell
# Generate SSH key
ssh-keygen -t ed25519

# Copy public key to Pi (replace with your Pi's address)
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh analog@raspberrypi.local "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Now you can connect with just:

shell
ssh analog@raspberrypi.local

With the Remote - SSH extension in VS Code, you get a full IDE experience directly on the Pi.

  1. Install the Remote - SSH extension (Microsoft) in VS Code
  2. Press F1"Remote-SSH: Connect to Host..."
  3. Enter: analog@raspberrypi.local
  4. VS Code opens a new window connected to your Pi
  5. You can now browse files, edit code, and use the integrated terminal on the Pi

Troubleshooting

ssh: connect to host raspberrypi.local port 22: No route to host

  • Pi may still be booting — wait 2 more minutes and try again
  • Check that Pi and laptop are on the same network/Wi-Fi
  • Try the IP address instead of hostname
  • Verify SSH was enabled in Imager settings (re-flash if needed)

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

You re-flashed the Pi and the SSH host key changed. Remove the old key:

shell
ssh-keygen -R raspberrypi.local
# Then reconnect

Connection times out immediately

Your Pi might not have connected to Wi-Fi. Check your Wi-Fi SSID and password in the Imager settings — they are case-sensitive. Re-flash if needed.


Next Steps

Previous
Flashing the OS