Loading...
Loading...
Loading...
Tech ExplainedAugust 1, 20234.9 MIN READ

How to SSH into Raspberry Pi

A photo of the orange Factor 200 series industrial Raspberry Pi computer from OnLogic

SSH, or the Secure Shell Protocol, is a network protocol that allows for safe access of another computer over an unsecure network. This connection, also called an SSH tunnel, is stable, secure, and widely used by system administrators to manage systems and applications remotely. 

This blog covers the steps on how to SSH into a Raspberry Pi system, such as our Industrial Raspberry Pi, the Factor 200 series. 

Explore the Factor 200 Series

Before setting this up, you’ll first need to ensure SSH is enabled. For security reasons, this feature is disabled by default. If SSH is already enabled and you already know your Raspberry Pi’s IP, you can skip the first three steps and go directly to How to SSH into Raspberry Pi.

Note: Steps and/or system specifics may differ from the steps listed below.

How to enable SSH from an existing Raspberry Pi OS

Note: This step assumes that the Raspberry Pi OS is already installed. If you are installing the Raspberry Pi OS from a removable media device (such as an SD card or a USB flash drive), skip directly to How to enable SSH during installation.

To enable SSH, connect your Raspberry Pi to a monitor and follow these steps:

  • Click on the Raspberry Pi icon on the desktop. Navigate to Preferences, then click on Raspberry Pi Configuration.

  • Click on the Interfaces tab and select Enable in the options for SSH.

  • Click OK.

Alternatively:

  • Open the Raspberry Pi Terminal.

  • Enter the command: sudo raspi-config

  • Use the arrow keys to navigate to Interfacing Options. Press the Enter key.

  • Go to SSH, and press enter.

  • When prompted, select <Yes>.

  • Select Enter to confirm, then click Finish to exit raspi-config.

  • Close the terminal window.

How to enable SSH during installation

If you’re installing Raspberry Pi from a removable media device for the first time, follow these steps to enable SSH:

  • Navigate to Advanced Options in Raspberry Pi Imager.

  • Click the checkbox next to Enable SSH.

  • Set up a username and password.*

  • Select Configure wireless LAN, and fill in the details.

  • Click Save, and write the operating system to the storage device of your choice.

*By default, the username is set to pi and the password is set to raspberry. Keeping the default username and password opens up your Raspberry Pi to malware attacks, so it’s important to always set up your own secure username and password before connecting your Raspberry Pi to the internet.

How to find Raspberry Pi IP

Before you can create an SSH tunnel, you’ll need to find out the IP address of your Raspberry Pi or its hostname. By default, your Raspberry Pi’s hostname will be set to either raspberrypi or raspberrypi.local. 

Raspberry Pi IP

The easiest way to find out the IP address of your Raspberry Pi is to check your router’s homepage, but if your Raspberry Pi is connected to a monitor, you can also check it by entering the following terminal command:

“hostname -I” *

*Note that this character is a capital i.

How to SSH into Raspberry Pi

Now that you have SSH enabled and you have the IP, you’re ready to SSH into your Raspberry Pi. The steps to do this will vary depending on whether you’re using Windows, Mac, or the Ubuntu Linux OS.

How to SSH into Raspberry Pi from Windows

There are many ways to SSH into a Raspberry Pi. In the following steps, we’ll show you how to do this using PuTTy (an open-source terminal emulator) or PowerShell. Note that these steps will work for both Windows 10 and 11.

PuTTy

To SSH into your Raspberry Pi from PuTTy:

  • Open PuTTy.

  • Under Host Name (or IP address), enter your Raspberry Pi’s IP address or hostname.

  • Make sure that Port is set to 22. If the Raspberry Pi SSH port is not set to 22, the connection will fail.

  • Under Connection type, select SSH.

  • Select Open, and enter your username and password.

PowerShell

To SSH into your Raspberry Pi using PowerShell, follow these steps:

  • Open a terminal on the device you would like to SSH into your Raspberry Pi from. In these steps, we’re using PowerShell.

  • To open PowerShell, either press Ctrl + Shift + P, or hit the Windows key and manually search for PowerShell.

  • Enter the command: ssh [username]@[hostname].local or ssh [username]@[IP address], replacing [username] and [hostname] or [IP address] with the details of your Raspberry Pi.

How to SSH into Raspberry Pi from Mac

To SSH into your Raspberry Pi from macOS:

  • Navigate to Applications > Utilities.

  • Open the terminal, and enter either ssh [username]@[hostname].local or ssh [username]@[IP address]. Replace[username] and [hostname] or [IP address] with the details of your Raspberry Pi.

How to SSH into Raspberry Pi: Ubuntu

To SSH into a Raspberry Pi from a Linux device:

  • Press Ctrl + Alt + T to open a terminal window.

  • Enter: ssh [username]@[hostname].local or ssh [username]@[IP address], and replace [username] and [hostname] or [IP address] with the details of your Raspberry Pi.

OnLogic is here to help

Have any questions we didn’t cover? Reach out to our technical support team, and check out our Factor 201 industrial Raspberry Pi.

O
OnLogic
OnLogic
OnLogic is a global industrial computer manufacturer that designs highly-configurable, solution-focused computers engineered for reliability for the IoT edge.

Stay in the know.

Get first access to the newest products and Industry 4.0 innovation, OnLogic Live! events and more.