Knowledge for the World

How to log in to a Raspberry Pi via SSH

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

1

Connect your Pi to your WiFi (or wired) network. Then, you'll need to open a 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.

2

Raspbian Jessie and Raspbian Stretch disable SSH by default for security reasons. If you're using an up-to-date version of Raspbian (as you should!), you'll need to enable SSH on your Raspberry Pi before proceeding.

3

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

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 pi@192.168.X.X

.. 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 'xxx (xxx)' 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.