Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Raspberry Pi

How to Set Up SSH on Raspberry Pi (Headless Setup Guide)

How to Set Up SSH on Raspberry Pi (Headless Setup Guide)

March 11, 2026 /Posted byJayesh Jain / 0

SSH (Secure Shell) is the most powerful tool in any Raspberry Pi user’s arsenal. It lets you connect to your Pi from any computer on your network — no monitor, no keyboard, no HDMI cable needed. Once SSH is set up, you can run commands, transfer files, and manage your Pi entirely from your laptop or desktop.

This guide covers every method to enable SSH on your Raspberry Pi, how to connect from Windows, Mac, and Linux, how to secure your SSH connection with keys instead of passwords, and how to troubleshoot the most common SSH problems. Whether you’re doing a headless setup from scratch or adding SSH to an existing installation, this guide has you covered.

Why Use SSH on Raspberry Pi?

SSH is fundamental to almost every serious Raspberry Pi project. Here’s why it matters:

  • No monitor required — Run your Pi as a silent server tucked away in a cabinet or on a shelf
  • Remote management — Manage your Pi from anywhere on your network, even from your phone
  • File transfers — Use SCP or SFTP to move files between your Pi and computer
  • Automation — Run scripts and commands remotely, integrate with CI/CD pipelines
  • Multiple sessions — Open several SSH terminals simultaneously for parallel tasks
  • Port forwarding — Tunnel other services (databases, web apps) securely through SSH
Recommended: Raspberry Pi 5 Model 4GB RAM — The best Raspberry Pi for headless SSH-based server setups. The Pi 5 handles multiple concurrent SSH sessions, Docker containers, and background services without breaking a sweat. 4GB RAM gives you room for everything from web servers to home automation hubs.

Method 1: Enable SSH During Flashing (Recommended for Headless)

This is the easiest and most reliable method — configure SSH before the OS is even installed. Using Raspberry Pi Imager’s advanced options, you can enable SSH, set credentials, and configure Wi-Fi all in one step.

  1. Download and open Raspberry Pi Imager from raspberrypi.com/software
  2. Select your OS and SD card as normal
  3. Click the gear icon (⚙️) or press Ctrl+Shift+X to open Advanced Options
  4. Check “Enable SSH” and select “Use password authentication”
  5. Set a username and strong password
  6. Set your Wi-Fi SSID and password (so the Pi connects automatically)
  7. Set your hostname (e.g., raspberrypi or mypi)
  8. Click Save, then Write

When you insert this SD card and power on the Pi, it will automatically connect to your Wi-Fi and have SSH ready on port 22. No monitor needed at any point.

To connect after boot:

ssh [email protected]

Replace yourusername with the username you set, and raspberrypi with your chosen hostname.

Method 2: Enable SSH via raspi-config (On a Running Pi)

If your Pi is already running and you have access to a terminal (either via monitor or another connection), use the built-in configuration tool:

sudo raspi-config

Navigate to:

  1. Interface Options
  2. SSH
  3. Select “Yes” to enable SSH server
  4. Press Finish

SSH starts immediately and will start automatically on every boot. No reboot required.

Method 3: Enable SSH Manually (Boot Partition Method)

This method is useful if you’ve already flashed an SD card without enabling SSH through Imager and don’t want to reflash. It works by placing a special file in the boot partition.

  1. Insert the flashed SD card into your computer
  2. Open the boot partition (it’s the small FAT32 partition visible as a drive on Windows/Mac)
  3. Create an empty file named exactly ssh (no extension, all lowercase) in the root of the boot partition
  4. On Windows: Right-click → New → Text Document, name it ssh, remove the .txt extension
  5. On Mac/Linux: touch /path/to/boot/ssh
  6. Safely eject and insert into the Pi

On first boot, Raspberry Pi OS detects this file, enables SSH, and deletes the file. SSH will then remain enabled permanently.

Note: On recent versions of Raspberry Pi OS (Bookworm), this method still works but you also need to set a username/password. Create a userconf.txt file in the boot partition with the format: username:encrypted_password. Generate the encrypted password with: echo 'yourpassword' | openssl passwd -6 -stdin

How to Connect via SSH from Any Computer

Once SSH is enabled on the Pi, connecting from your computer depends on your OS:

From Linux or macOS

Open Terminal and run:

ssh [email protected]

Accept the fingerprint warning on first connection (type yes), then enter your password.

From Windows 10/11

Windows has a built-in SSH client since Windows 10 version 1809. Open Command Prompt or PowerShell and run:

ssh [email protected]

If .local doesn’t resolve, use the IP address instead. Find the IP from your router’s admin panel.

From any device using PuTTY

PuTTY is a popular free SSH client for Windows. Download from putty.org, enter the Pi’s hostname or IP in the “Host Name” field, ensure port 22 is set, and click Open.

Recommended: Raspberry Pi 5 Model 2GB RAM — For SSH-only, headless server deployments, the 2GB Pi 5 is the value champion. You’ll rarely use more than 500MB RAM running typical server workloads — web server, Pi-hole, home automation, or VPN. Get full Pi 5 speed at the lowest entry price.

How to Find Your Raspberry Pi’s IP Address

If raspberrypi.local doesn’t work (it requires mDNS/Bonjour support on your network), you’ll need the IP address. Several methods work:

  • Router admin panel: Log into your router (usually 192.168.1.1 or 192.168.0.1) and look for connected devices. Your Pi will appear with its hostname.
  • nmap scan: On Linux/Mac: nmap -sn 192.168.1.0/24 (replace with your subnet) — lists all devices
  • Angry IP Scanner: A free GUI tool for Windows/Mac that scans your network and shows all devices
  • From the Pi directly: If you have any access to the Pi, run ip addr show or hostname -I
  • HDMI + keyboard briefly: Connect a monitor just to see the IP printed at login, then remove the monitor

Setting Up SSH Key Authentication (More Secure)

Password-based SSH is fine, but SSH keys are more secure and more convenient — no password to type every time. Here’s how to set them up:

Step 1: Generate a key pair on your computer

ssh-keygen -t ed25519 -C "[email protected]"

Press Enter to accept the default location (~/.ssh/id_ed25519). Optionally add a passphrase for extra security.

Step 2: Copy the public key to your Pi

On Linux/Mac:

ssh-copy-id [email protected]

On Windows (using PowerShell):

type $env:USERPROFILE.sshid_ed25519.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Step 3: Test key login

ssh [email protected]

If it logs in without asking for a password, keys are working.

Step 4: Disable password authentication (optional but recommended)

On your Pi, edit /etc/ssh/sshd_config:

sudo nano /etc/ssh/sshd_config

Find and set:

PasswordAuthentication no

Then restart SSH:

sudo systemctl restart ssh
Recommended: Raspberry Pi 5 Model 16GB RAM — Running multiple SSH-accessible services on one Pi? The 16GB Pi 5 handles everything — Nextcloud, Home Assistant, Jellyfin, databases, and more — all simultaneously. SSH into it from anywhere and manage your entire home server setup.

Securing Your SSH Server

Default SSH settings are adequate for local network use, but if you’re exposing SSH to the internet (or just want best practices), apply these hardening steps:

  • Change the default port: Set Port 2222 (or any non-standard port) in sshd_config to reduce automated scans
  • Disable root login: Set PermitRootLogin no in sshd_config
  • Use SSH keys only: Set PasswordAuthentication no after setting up keys
  • Install fail2ban: sudo apt install fail2ban — automatically bans IPs that fail repeated login attempts
  • Limit login attempts: Set MaxAuthTries 3 in sshd_config
  • Allow specific users only: Add AllowUsers yourusername to sshd_config
Recommended: HAT DIY PCB Prototyping Board for Raspberry Pi Zero — Building a custom IoT node that you’ll manage exclusively via SSH? The Pi Zero HAT prototyping board lets you add custom circuits directly on top of the Pi Zero, creating compact, self-contained devices you can deploy anywhere and manage remotely.

SSH Troubleshooting

If SSH isn’t working, work through these steps:

  • “Connection refused”: SSH isn’t enabled. Enable it via raspi-config or reflash with SSH enabled in Imager.
  • “Connection timed out”: Can’t reach the Pi. Check that it’s on the network. Verify IP address. Check that the Pi has fully booted (give it 60 seconds after power-on).
  • “Host key verification failed”: The Pi’s key changed (e.g., after OS reinstall). Remove the old key: ssh-keygen -R raspberrypi.local
  • “Permission denied”: Wrong username or password. Check credentials. If using keys, verify the public key is in ~/.ssh/authorized_keys on the Pi.
  • “.local doesn’t resolve: Use the IP address directly. Install Bonjour Print Services on Windows for mDNS support.
  • Wi-Fi not connecting on first boot: Check that SSID and password were correctly set in Imager. Try a wired ethernet connection instead.

Frequently Asked Questions

What port does SSH use on Raspberry Pi?

SSH uses port 22 by default on Raspberry Pi OS, just like any Linux system. You can change this in /etc/ssh/sshd_config by setting a different port number. If you change it, remember to specify the port when connecting: ssh -p 2222 username@hostname.

Can I use SSH on Raspberry Pi without Wi-Fi?

Yes. Connect the Pi to your router via an ethernet cable. SSH works over any network connection — wired or wireless. Wired is actually more reliable and faster for SSH connections.

How do I transfer files to Raspberry Pi via SSH?

Use SCP (Secure Copy) or SFTP. From your computer: scp localfile.txt [email protected]:/home/username/. For a graphical interface, use FileZilla or WinSCP with the SFTP protocol and your Pi’s credentials.

Can multiple people SSH into a Raspberry Pi at the same time?

Yes. SSH supports multiple simultaneous sessions. Each person gets their own independent terminal session. The Pi handles concurrent SSH connections well — you can have several terminals open at once without any issues.

Is SSH safe on a local network?

Yes, SSH is encrypted and secure by default. On a local home network, even password authentication is generally safe. For internet-exposed SSH, use key-based authentication and consider fail2ban as additional protection.

Start Managing Your Raspberry Pi Remotely

SSH transforms your Raspberry Pi from a desktop computer into a powerful remote-managed server. Once you’ve set it up — preferably with key-based authentication — you’ll rarely need a monitor again. Your Pi can sit silently wherever it makes sense and be fully manageable from the comfort of your laptop.

Ready to build your headless Raspberry Pi setup? Find the complete range of Raspberry Pi boards, accessories, and sensors at Zbotic.in. We carry Pi 5 models, cameras, HATs, displays, and everything you need for your next project — with fast shipping across India.

Tags: headless setup, Raspberry Pi, Raspberry Pi networking, Raspberry Pi SSH, SSH
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Arduino SD Card Module: Read W...
blog arduino sd card module read write files with fat library 595033
blog arduino serial communication uart softwareserial debugging 595035
Arduino Serial Communication: ...

Related posts

Svg%3E
Read more

Raspberry Pi Benchmarks: Performance Testing All Models

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading
Svg%3E
Read more

Raspberry Pi PoE: Power Over Ethernet Setup Guide

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading
Svg%3E
Read more

Raspberry Pi GSM HAT: SMS and Cellular IoT

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading
Svg%3E
Read more

Raspberry Pi RS485: Industrial Sensor Network

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading
Svg%3E
Read more

Raspberry Pi CAN Bus: Vehicle OBD2 Data Reader

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading

Add comment Cancel reply

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

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now