Home Interests Raspberry Pi

How to Connect to a Raspberry Pi Remotely via SSH

The preferred (and most common) method of connecting to your Pi to run commands.
howchoo   (467)
September 20, 2023
7 minutes

Share

You'll Need 1

What you'll need
Interests
Series
Howchoo is reader-supported. As an Amazon Associate, we may earn a small affiliate commission at no cost to you when you buy through our links.
Posted in these interests:
linux • 12 guides
pi • 92 guides

This guide will show you how to connect to your Raspberry Pi remotely via SSH from your laptop or desktop computer.

How to SSH into Raspberry Pi

SSH (Secure SHell) is the best method of connecting to your Raspberry Pi. Therefore, this is the method we’ll be using to log in.

1 – Open a command line

Connect your Pi to your WiFi (or wired) network. Then, open a new command line:

For Mac:

Open Terminal by navigating to Applications > Utilities > Terminal.

For Windows 10+:

Open Command Prompt by right-clicking the Start button and selecting Command Prompt.

Note: For Windows, you’ll need to install Putty and follow these instructions before proceeding.

🛈 For other versions of windows, simply search your computer for the Command Prompt application.

2 – Enable SSH

Older versions of Raspberry Pi OS like Raspbian Jessie, Raspbian Stretch, and Raspbian Buster have SSH disabled by default for security reasons. If you’re using an up-to-date version of Raspberry Pi OS (as you should!), you’ll need to enable SSH on your Raspberry Pi before proceeding.

How to Enable SSH on Raspberry Pi OS Without a Screen
The SSH protocol is disabled by default.

3 – Get the username and password

The default username and password for the Raspberry Pi is:

username: pi
password: raspberry

Of course, if you’ve changed the password you’ll need to use the updated password.

4 – Use the SSH command

The default hostname for the Pi is raspberrypi, so in your command line app, enter the following and press enter:

ssh pi@raspberrypi

Note: Certain distributions (like RetroPie) change the hostname by default — for example, the default hostname for RetroPie is retropie, so you’d connect using that in place of raspberrypi. You can quickly check whether your Pi uses a certain hostname by pinging it and trying each hostname:

ping raspberrypi

You can also connect using your Raspberry Pi’s IP address:

ssh [email protected]

.. where 192.168.X.X is your Pi’s IP address. You can obtain your Pi’s IP address using the ping command above.

Type the password when you see the password prompt. For security purposes you won’t see the password as you type.

You might encounter a host verification warning that ends with something like this:

The authenticity of host 'abc (abc)' can't be established.
RSA key fingerprint is 3f:1b:f4:bd:c5:aa:c1:1f:bf:4e:2e:cf:53:fa:d8:59.
Are you sure you want to continue connecting (yes/no)? 

Just type “yes” and hit enter. This is a security measure to let you know you’re trying to connect to a host for the first time. After connecting, the host will be added to the known_hosts file, and you won’t see this warning again.

🛈 Make sure your computer is on the same network as your Pi.
NEXT UP

How to Run a Minecraft Server on the Raspberry Pi

A whole world trapped inside your Pi.
howchoo   (467)
December 7, 2023

There are several ways to go about running a Minecraft server on the Raspberry Pi. In this guide, I’ll cover how to install Nukkit—a cross-platform Minecraft server that’s super easy to set up on the Raspberry Pi. This server should work with PCs, consoles, and tablets running Minecraft 1.14. I’ll be using a Raspberry Pi

Continue Reading

howchoo

 467 guides

Introducing Howchoo, an enigmatic author whose unique pen name reflects their boundless curiosity and limitless creativity. Mysterious and multifaceted, Howchoo has emerged as a captivating storyteller, leaving readers mesmerized by the uncharted realms they craft with their words. With an insatiable appetite for knowledge and a love for exploration, Howchoo's writing transcends conventional genres, blurring the lines between fantasy, science fiction, and the surreal. Their narratives are a kaleidoscope of ideas, weaving together intricate plots, unforgettable characters, and thought-provoking themes that challenge the boundaries of imagination.

Discover interesting things!

Explore Howchoo's most popular interests.

Explore