How To SSH into Raspberry Pi (A Definitive Guide)

In order to get the most out of your experience with Raspberry Pi, you will need to know how to enable and use SSH as part of the system. SSH – or Secure Shell – refers to a specific network communication tool that offers users the opportunity to operate their Pi remotely and securely, with the benefit of encryption.

SSH can also be extremely useful for managing your Pi, or moving files, using commands – this eliminates the need for you to move yourself or your Pi every single time.

Remote access and usage offers greater convenience and ease, especially when it is combined with so-called “headless mode”, which allows you to operate Raspberry Pi’s minus a dedicated desktop or monitor.

You can set up the desired configuration onto your device, and simply leave it, free from the fear that someone will come along and disrupt things.

Learning how to use SSH as part of Raspberry Pis is a fairly simple process, and we have put together everything you need to know to get the job done in no time.

Jerome E. Altarejos

What Is Raspberry Pi?

Raspberry Pi is an inexpensive computer designed for use as both a hobbyist project and educational tool. It was originally released by UK company,

The Raspberry Pi Foundation, and has been developed ever since, primarily for use as a platform for learning about Linux and programming.

Although it may not initially seem like much, Raspberry Pi contains a Broadcom BCM2835 single-core ARMv6 CPU at 1GHz, 128MB RAM, 4GB eMMC storage, and VideoCore IV GPU running OpenGL ES 2.0. It is ideal for home computing, as it has enough power – yet is small enough to carry around.  

What Software Do Raspberry Pi’s Come With?

Raspberry Pies preloaded with their operating system are usually around 8 GB in size.

This includes everything you need to get started right away, including programs and applications for various functions, such as networking, playing games, making music, and interacting with the world around us.

The most common program found on a Pi is the XBMC Media Center, which lets you watch movies, listen to music, play video games, browse the Internet, surf social media websites like Facebook, Twitter, YouTube, and Reddit, as well as offer the chance to download many different types of media.

Another popular option tends to be RetroPie – this is free and allows users to emulate classic retro gaming platforms like NES, Sega Genesis, SNES, Game Boy Advance, Super Nintendo Entertainment System/System 16, GBA SP, Neo Geo Pocket Color, Nintendo 64, Atari 2600, ColecoVision, Amiga 500, ZX Spectrum and others.

A third popular tool to use on many Raspberry Pi’s is Node-RED, which makes it easy to create interactive visualizations, flow charts, or data dashboards for IoT devices, mobile apps, and data analysis based on real-time sensor input.

It’s also very useful for debugging any kind of hardware issues, such as connecting multiple sensors together for monitoring air quality, temperature, humidity, light level, or just a simple smoke detector.

Finally, you might enjoy a simple HTML5 game such as Angry Birds, Snake, or Fruit Ninja. Overall, Raspberry Pi’s offer a solid, versatile system, which has a lot to offer users.

What Is SSH?

As we have mentioned, SSH stands for Secure Shell and allows users to connect to a server or system remotely from another device.

The key advantage behind SSH is that all communications can be encrypted, making it harder for hackers to intercept your messages and steal data. This extra protection is a major appeal for many users.

How Can I Enable The Secure Shell On Raspberry Pi?

For Raspberry Pi versions created after late 2016, SSH access is, by default,  disabled when you start the system – this is an extra measure in place to help improve and boost security.

The good news is that you can get around this security, and there are three methods that tend to be the most popular – we will explore these in greater detail below.

Method 1: Using “Headless” Mode

We earlier very briefly touched on a concept known as “headless mode” – but what do we mean by this, and what does it have to do with SSH?

As we explained briefly earlier, so-called “headless mode” allows users to control and configure their Raspberry Pi device without connecting a dedicated keyboard, mouse, and even a screen if desired.

In this mode, Raspberry Pi’s do not require any external devices or peripherals, and this makes it ideal for a number of applications and uses, including installing various software packages and managing files.

To start, you will be required to create a fresh, empty SSH file using a separate machine to your Raspberry Pi – if the Raspbian is already ready and installed on an existing microSD card for Pi, you should start by turning off your device, and removing the card, before placing a microSD card into your card reader.

Connect your card reader to the other computer, and wait a few moments for it to be recognized in your system.

Once it has been recognized, head to the designated root folder located in the SD card – known as the “boot” folder”.

If using a Windows machine, you can use the File Explorer function to locate this, while Mac and Linux OS will require you to open the terminal and create an instruction:

cd /Volumes/boot.

Once you are in, you will see that when Raspberry Pi OS is installed onto the SD card being used, the default volume name is set to “Boot”.

If the SD card is named something else, you will need to rectify this by heading to the folder marked “root volume”, finding the  area marked boot volume, and creating a file with no extension. Name this “ssh”.

If you are using a Windows PC, right-click, select New>Test Document, and always delete the extension marked .txt prior to saving the file.

(Remember, if your file extensions are not visible in your  File Explorer, you can click the ribbon along the top to find the “View” tab, and make sure that Filename extension is checked).

If you are running a Linus or Mac OS, you will need to run a command line while within the boot directory, allowing you to create a black “ssh” file. The instruction should be:

touch ss

Once this is complete, eject your SD card safely from the device, and mount the SD card to the Pi, before turning the device on. Now, each time your device starts up, it knows to check for the presence of the “ssh” file and will execute this to enable SSH access automatically.

Method 2: Use GUI Configuration

The Headless mode is a great option if you do not have a monitor, but there is an easier way if you have a monitor and peripherals connected to the Pi. In this case, you can enable “ssh” through use of GUI configuration, and the process is much easier and more efficient.

GUI configuration refers to enabling the user interface through some sort of graphical methods, such as a desktop environment, instead of simply having text directions executed.

Note that GUIs are not always more secure than the traditional method, so think about whether they are really necessary for your needs before choosing the latter.

To enable ssh through the GUI configuration method, start by opening Raspbian Settings from your desktop, using the Raspberry logo, located in the top left- hand corner, and navigate to your Preferences page. Click the option to Configure – this is located at the bottom of the menu on the screen – and then select “Interfaces”. 

Then, scroll down until you find the “SSH” section in the list. Toggle the switch next to “Enable SSH” to enable it. Press OK, and log out, and back in again. Open another web browser, and enter your IP address into the URL bar.

You should now be able to login into any Raspberry Pi remotely and connect via SSH.

Note, however, that once you disable the network connection, you cannot reenable it without rebooting. Also, disabling the WiFi adapter disables all network connectivity, which means you will not be able to connect to your device over any other medium either. If this is important to you, you may want to consider using Method 1 above.

Method 3: Via Terminal

SSH can also be enabled on your Pi using the Terminal, and there are two main options here. The “raspi-config” tool can be activated by opening the Terminal, and running the following:

sudo raspi-config

The tool will then load, allowing you to choose “Interfacing Options”. You will be asked “Would you like the “SSH” server to be enabled” – select the “Yes” option and then click Enter. Click “Finish” to close raspi-config, and close the Terminal window – SSH is now enabled on your device.

Another option for enabling SSH via the terminal is “systemctl”. Once again, this is activated by opening the Terminal, and running a number of directions:

“sudo systemctl enable ssh”

“sudo systemctl start ssh”

Run the following to enable the “SSH” mode on your Pi.

Once you have chosen one of the options above to enable SSH onto your system, the next step is to open the Raspberry Pi using the “SSH”, and we will take a closer look at this below.

How to SSH into Raspberry Pi

How To Start New SSH Sessions On Raspberry Pi Machines

Once your device is enabled using one of the methods above, you will need to locate your  IP address allocated to your Pi by running the following in the Terminal:

hostname -l

Write down the IP address somewhere accessible for reference. If you are running a Linux or Mac system, you then simply need to open the Terminal and run the following:

ssh [email protected][IPADDRESS]

Replace [IPADDRESS] with your IP address that you found earlier.

For Windows users, there are a couple of extra steps to use SSH within Raspberry Pi. start heading to the “PuTTy” website, and downloading the program. Launch “PuTTy”, and add in the IP address that you discovered.

Check your settings to ensure that the “SSH” box is selected and that you check that the port is set to 22. Then, click to open a new SSH session, and enter the username of your Pi, followed by the password – you will now be ready to make the most of SSH.

Double Checking SSH

If you ever need to check whether the “SSH” service is enabled on any Raspberry Pi, you can use the command:

sudo systemctl status sshd

If you receive no output, the “SSH” service has been successfully enabled. Otherwise, if you receive an error message, such as:

sshd.service – Start remote shell serviced

loaded failed failed, try setting Load FailureActions ignore

Loaded: loaded (/lib/systemd/system/sshd.service; disabled)

Active: inactive (dead)

Or similar, you will need to adjust your configuration files, and uncover the source of the issue.

Final Thoughts

There are many ways to access Raspberry Pi remotely, but as mentioned above, SSH is probably the most popular method due to its simplicity.

It’s great to know that SSH is built right into any Raspberry Pi that you are using, offering extra convenience and peace of mind.

With so many options and methods available, this should be a fairly simple and straightforward process that helps you to get the very most out of using your Raspberry Pi, and ensure that your data and details are secure and encrypted.

Melanie Nilsen
Latest posts by Melanie Nilsen (see all)