A Beginner’s Guide to SSH on a Raspberry Pi

 

A Beginner’s Guide to SSH on a Raspberry Pi

SSH (Secure Shell) allows you to access and control your Raspberry Pi remotely from another device, like a laptop or desktop. Instead of plugging in a monitor and keyboard, you can log in through the command line and work on your Pi as if you were right in front of it.


Step 1: Enable SSH on Your Raspberry Pi

By default, SSH might be disabled on your Raspberry Pi. To enable it:

  1. Boot up your Raspberry Pi and open the terminal.
  2. Type "sudo raspi-config"
  3. Navigate to Interfacing Options → SSH → Enable
  4. Exit and reboot your Pi if needed.

Alternatively, if you're setting up your Pi headless (without a monitor), you can enable SSH by adding an empty file named ssh (no extension) to the boot partition of the SD card.


Step 2: Find Your Raspberry Pi’s IP Address

To connect, you'll need your Raspberry Pi’s IP address. Find it by running:

Bash
hostname -I

Or check your router’s connected devices list. The IP will look something like 192.168.1.100.


Step 3: Connect to Your Raspberry Pi from Another Device

From a Windows, Mac, or Linux terminal, type:

Bash
ssh pi@192.168.1.100

Replace 192.168.1.100 with your actual Raspberry Pi IP address. The default username is pi, and the default password is raspberry (change this ASAP for security).

If you're on Windows and don't have SSH built-in, use PuTTY (a free SSH client).


Step 4: Basic Linux Commands

Once connected via SSH, you can control your Pi as if you're using its terminal directly.

CommandDescription
lsList files in the current directory
cd foldernameNavigate to a folder
nano filenameEdit a text file
sudo rebootRestart the Pi
exitClose the SSH session


Step 5: Secure Your SSH Connection (Optional but Recommended)

To prevent unauthorized access:

  • Change the default password: Run passwd after logging in.
  • Use SSH keys instead of passwords: Set up an SSH key for easier, more secure logins.
  • Disable SSH root login: Edit /etc/ssh/sshd_config and set PermitRootLogin no.


Final Thoughts

SSH makes it easy to manage your Raspberry Pi remotely without needing a monitor or keyboard. Once you're comfortable, you can explore using SSH for file transfers, automation, and even remote scripting. 


Need Raspberry Pi Expertise?

If you need help with your Raspberry Pi projects or have any questions, feel free to reach out to us!

Email us at: info@pacificw.com


Image: Gemini

Comments

Popular posts from this blog

The New ChatGPT Reason Feature: What It Is and Why You Should Use It

Raspberry Pi Connect vs. RealVNC: A Comprehensive Comparison

The Reasoning Chain in DeepSeek R1: A Glimpse into AI’s Thought Process