In this guide, we will show you how to enable and use SSH on your Raspberry Pi.
SSH stands for “Secure Shell” and is one of the most useful ways for remotely managing a device such as the Raspberry Pi.
Using SSH, we will be able to interact with the Raspberry Pi’s command line without having to have a keyboard, mouse or screen connected to it. It is very useful for a lot of Raspberry Pi projects that don’t require you to be at the Pi.
The process of using SSH is straightforward and should be easy enough for anyone to pick up.
Below is a list of the equipment that we used when setting up SSH on our Raspberry Pi.
Raspberry Pi 1, 2, 3 or 4
If you would like to watch a video on how to setup SSH on your Raspberry Pi, be sure to check out the video below.
Alternatively, you can read our written guide below.
Enabling SSH on the Raspberry Pi
There are three different ways to set up SSH on your Raspberry Pi that we will be delving into. For all three of these methods, you should be running Raspbian,
These three different methods are:
- Using the Raspbian Desktop Interface
- Making use of the Raspi-Config command-line tool
- Setting up SSH with a headless (No Screen) setup
All three of these methods are relatively easy to follow, so pick the option that best suits your needs.
One of the first things you should do before or after enabling SSH on your Raspberry Pi is to change the default Raspbian password.
Enabling SSH from the Raspbian Desktop
The first method that we are going to be showing you requires you to be running a version of Raspbian that includes a desktop interface.
For this method, you will need to have a screen, keyboard, and mouse.
1. With your Raspberry Pi loaded, click the Raspberry Pi Icon to bring up the start menu.
2. Next, hover over the “Preferences” option (1.).
Finally, click the “Raspberry Pi Configuration” option (2.).
Following these steps will bring up the configuration page where we will be able to enable SSH.
2. Now, to enable SSH on your Raspberry Pi, click the “Interfaces” tab (1.).
Then click the “Enabled” radio box next to the “SSH:” option (2.).
Once you have enabled SSH, click the “OK” button (3.) to confirm the settings change.
Enabling SSH from the Command Line
This section will show you how to use the command line to enable SSH on your Raspberry Pi.
For this method to work, you will need access to a keyboard, mouse, and screen.
1. The easiest way to enable SSH without a GUI is to make use of the raspi-config tool.
To open the
raspi-config tool, run the following command.
2. Within the tool use the arrow keys on your keyboard to select “
5 Interfacing Options“.
Once selected, press the ENTER key.
3. Now in this next menu, select the “
P2 SSH” option.
4. You will see a prompt asking if you want to enable the SSH server on your Raspberry Pi.
To enable SSH, select the “
<Yes>” option and press the ENTER key.
5. SSH should now be successfully enabled.
Select the “
<Yes>” option to continue.
5. Now quit out of the tool by selecting the “
<Finish> option and pressing ENTER.
Enabling SSH on a Headless Raspberry Pi
In this final section, we will be showing you how to enable SSH when using a Raspberry Pi in a headless (No screen) environment.
Raspbian is built with a feature so that when it boots up, it will look for a file called
ssh within the boot partition.
If the operating system finds this file, it will automatically enable SSH and delete the file.
1. On your Windows, Linux, or macOS device, insert your Raspberry Pi’s SD Card.
This SD card should already have the Raspbian operating system installed to it.
2. With the SD card connected to your device, open up the partition named “
3. In this partition, create a file called “
This file does not need to contain anything. All that matters is that the name is correct.
4. Now, insert the SD Card back into your Raspberry Pi and turn it on.
After your Raspberry Pi has finished booting, you should now be able to SSH to your Raspberry Pi.
Connecting to Your Raspberry Pi over SSH
In this section, we will be showing you how to connect to your Raspberry Pi over SSH using Windows, Linux, or macOS.
As you will soon find out, connecting using SSH is a very straightforward and quick process.
Using SSH on Windows
In this section, we will be showing you how to connect to your Raspberry Pi over SSH on Windows.
Compared to Linux and Mac, Windows is the slightly more complicated one. The reason for this is that unlike those operating systems, Windows does not have an SSH client built-in.
To resolve this, we will be making use of a popular tool called Putty.
1. To start, you need to download and install Putty to your Windows device.
You will find the downloads you are after under the MSI (‘Windows Installer’) header.
2. Upon launching Putty, you will be greeted by the following screen.
There is a couple of boxes that need filling out on this screen.
First, you need to specify the IP address of the device you want to connect to. (1.)
Next, make sure that the port is set to
22 (2.). This is the default port number for SSH.
Once you have set the IP address and port, click the “Open” button (3.).
If you don’t know your Pi’s IP address, then you can follow our guide on finding it’s IP.
3. As this is the first time connecting to your Raspberry Pi, you will be warned that the SSH key is not known.
You need to click the “Yes” button to continue with the connection.
Upon the initial connection, you will be asked to enter the username that you are trying to connect using and also the password for that user.
If you are still using the default user and password, these will be
4. You should now have successfully connected to your Raspberry Pi over SSH from Windows.
Using SSH on Mac & Linux
Both macOS and Linux come with SSH tools installed out of the box. Having these tools built-in makes it incredibly simple to connect to your Raspberry Pi over SSH.
1. On your chosen operating system, begin by opening up the terminal app.
2. Now in the terminal, run the following command.
When running this command, make sure that you replace “
192.168.0.115” with your Raspberry Pi’s own IP address.
If you would like to SSH into your Raspberry Pi using a different user, all you need to do is replace
pi with your chosen username.
3. You will receive a warning about being unable to verify the authenticity of the host.
To continue, type
Yes into the command line and press the ENTER key to confirm it.
4. You should now be prompted to enter the password for your
If you are still using the default password, type in
raspberry and press the ENTER key.
5. You should now be successfully connected to your Raspberry Pi over SSH from your macOS or Linux device.
If you have run into any issues with connecting using SSH, you can try using the following tips.
“I am getting a connection error”
Most connection issues with SSH or caused by one or two things.
First, make sure that your Raspberry Pi is connected to the same network as the device you are connecting from.
Secondly, make sure that you are using the correct IP address for your Raspberry Pi. If you are unsure of how to find this, we have a guide on retrieving the Pi’s IP address.
If you intend to connect to your device from outside your home network, make sure that you port forward port
22 and that you are using a password or SSH keys.
“I am getting access denied”
Access denied errors are typically caused by using an incorrect username or password.
Make sure that the user you are trying to connect with exists and that the password that you are typing in is correct.
If you are still using the default login, then the username should be
pi and the password
Hopefully, at this point in the guide, you will now have a good understanding of how to enable and connect using SSH on your Raspberry Pi.
If you have run into any issues with this guide, feel free to drop a comment below.