To SSH into your Raspberry Pi, you need to enable SSH first, then connect using the command ssh username@ip_address from your computer’s terminal. The default username is usually pi or your custom username, and you’ll need your Pi’s IP address on the network.
What is SSH and Why Use It?
SSH (Secure Shell) allows you to remotely access and control your Raspberry Pi from another computer over a network connection. This is essential for headless setups (no monitor/keyboard attached) and remote management of your Pi projects.
3 Easy Steps to SSH into your Raspberry Pi
- Enable SSH on Your Raspberry Pi
- Find Your Raspberry Pi’s IP Address
- Connect to Your Raspberry Pi via SSH
Step 1: Enable SSH on Your Raspberry Pi
Method 1: Using Raspberry Pi Imager (Recommended for New Installations)
The easiest way to pre-configure a Raspberry Pi for headless usage is to use the Advanced Options in Raspberry Pi Imager. By enabling remote access and pre-configuring the user, password and network, the Raspberry Pi will be immediately accessible on first boot.
- Download and install Raspberry Pi Imager
- Select your Raspberry Pi OS image
- Click the gear icon (Advanced Options)
- Enable SSH and set authentication method
- Configure username and password
- Set up Wi-Fi credentials if needed
- Write the image to your SD card
Method 2: Creating SSH File for Headless Setup
SSH is enabled immediately upon booting up the OS. To enable SSH on Raspberry Pi in headless mode, create a file called ssh in the boot or bootfs directory.
- After flashing Raspberry Pi OS to SD card, locate the boot partition
- Create an empty file named ssh (no extension)
- Insert SD card into Raspberry Pi and power on
- SSH will be enabled automatically on boot
Method 3: Using Desktop Interface (If You Have Monitor Access)
First go to the Raspberry Pi configuration window by navigating through the menu. Now, go to the interfaces tab, enable SSH and restart your Pi.
- Click the Raspberry Pi icon in top-left corner
- Navigate to Preferences → Raspberry Pi Configuration
- Go to the Interfaces tab
- Enable SSH
- Restart your Pi
Method 4: Using Command Line
You can also enable SSH without via the terminal. Just enter the command sudo raspi-config and then go to Advanced Options to enable SSH.
- Open terminal on your Pi
- Run: sudo raspi-config
- Navigate to Interface Options → SSH
- Select “Yes” to enable SSH
- Reboot your Pi
Step 2: Find Your Raspberry Pi’s IP Address
You need your Pi’s IP address to connect via SSH. Here are several methods:
From Your Pi (if you have access)
hostname -I
From Your Router
- Access your router’s admin panel
- Look for connected devices or DHCP client list
- Find your Raspberry Pi in the list
Using Network Scanner
- Windows: Use Advanced IP Scanner or Angry IP Scanner
- macOS/Linux: Use nmap command
nmap -sn 192.168.1.0/24
Using ping
ping raspberrypi.local
Step 3: Connect to Your Raspberry Pi via SSH
From Windows
Using Command Prompt or PowerShell:
ssh username@192.168.1.100
Using PuTTY:
- Download and install PuTTY
- Enter your Pi’s IP address in “Host Name”
- Select SSH connection type
- Click “Open”
- Enter username and password when prompted
From macOS or Linux
Open Terminal and run:
ssh username@192.168.1.100
Default Login Credentials
- Username: pi (for older installations) or your custom username
- Password: raspberry (default) or your custom password
Important Security Note: Change the default password immediately after first login using:
passwd
Final Thoughts
SSH access to your Raspberry Pi opens up powerful remote management capabilities. SSH is enabled immediately upon booting up the OS when properly configured, making it an essential tool for headless Pi projects.
Remember to prioritize security by changing default passwords, using SSH keys, and keeping your system updated. With SSH properly configured, you can manage your Raspberry Pi projects from anywhere on your network.
For ongoing management, consider setting up automatic security updates and monitoring SSH access logs to maintain a secure remote access environment.
Frequently Asked Questions (FAQs)
What’s the default SSH port for Raspberry Pi?
The default SSH port is 22, same as most Linux systems.
Can I SSH into Raspberry Pi over the internet?
Yes, but you need to configure port forwarding on your router and implement proper security measures.
Why does SSH keep asking for password?
This usually means SSH key authentication isn’t set up properly, or the keys don’t match.
How do I transfer files via SSH?
Use SCP (Secure Copy) or SFTP:
scp file.txt username@192.168.1.100:/home/username/
Can multiple users SSH simultaneously?
Yes, Raspberry Pi supports multiple concurrent SSH connections.
Priya Mervana
Verified Web Security Experts
Priya Mervana is working at SSLInsights.com as a web security expert with over 10 years of experience writing about encryption, SSL certificates, and online privacy. She aims to make complex security topics easily understandable for everyday internet users.