Establishing a Raspberry Pi SSH connection: A step-by-step guide

The Raspberry Pi is a versatile, low-cost single-board computer that is suitable for numerous projects. One of its practical features is the ability to connect to it via SSH (Secure Shell). This lets you access the Raspberry Pi’s command line from another computer without having to be physically connected to the device. In this article, we explain step by step how to connect to your Raspberry Pi via SSH.

Prerequisites

Before you start with SSH access, make sure you have the following things ready:

  1. Raspberry Pi: The Raspberry Pi should be correctly installed and booted.
  2. Network connection: Your Raspberry Pi should either be connected to the router via an Ethernet cable or connected to a Wi-Fi network.
  3. SSH client: You will need an SSH client on your computer. Windows users can use PuTTY, while macOS and Linux users can use the built-in terminal.

Step 1: Activate SSH on the Raspberry Pi

SSH is disabled by default on the Raspberry Pi. You must enable it before you can connect.

Method 1: Via the configuration of the SD card (before the first start)

  1. Prepare the MicroSD card: When you set up your Raspberry Pi for the first time, insert the MicroSD card into your computer.
  2. Create the SSH file: Create an empty file named ssh (without a file extension) in the root directory of the MicroSD card. This activates SSH the next time you start the Raspberry Pi.
  3. Reinsert the card: Reinsert the MicroSD card into the Raspberry Pi and start the device.

Method 2: Via the Raspberry Pi console

  1. Log in to the Raspberry Pi: Log in directly to the Raspberry Pi (either via a connected display and keyboard or via the console if you already have access).
  2. Activate SSH: Open the terminal and run the following command:
sudo raspi-config

Navigate to “Interfacing Options” and select “SSH” to enable SSH.

See also  Unraid vs Freenas

Step 2: Find out the IP address of the Raspberry Pi

To connect to your Raspberry Pi via SSH, you need the IP address of the device.

  1. Directly on the Raspberry Pi: Open the terminal and enter the following command:
hostname -I

The IP address is displayed.

  1. Via the router: You can also find out the IP address via the web interface of your router. Look for a connected device called “raspberrypi” or a similar name.

Step 3: Establish the SSH connection

On Windows

  1. Download PuTTY: If you haven’t installed PuTTY yet, download it from the official website and install it.
  2. Start PuTTY: Open PuTTY.
  3. Configure the connection:
  • Enter the IP address of the Raspberry Pi in the “Host Name (or IP address)” field.
  • Make sure the port is set to 22 and the connection type is set to “SSH”.
  1. Establish the connection: Click “Open”. A new window opens and asks you to enter your user name and password.
  2. Log in: Enter the user name pi and the password raspberry (or your own password if you have changed it).

On macOS and Linux

  1. Open the terminal: Open the terminal.
  2. Use the SSH command: Enter the following command, replacing username with your user name and IP_ADDRESS with the IP address of your Raspberry Pi:
ssh username@IP_ADDRESS

By default, the user name is pi. If you use the default credentials, the command is:

ssh pi@IP_ADDRESS
  1. Enter the password: Enter the password when prompted. The default password is raspberry, unless you have changed it.

Step 4: Usage and safety

  • Command input: After successfully logging in, you can enter commands directly in the terminal as if you were working on the Raspberry Pi itself.
  • Security: Be sure to change the default password after the first login to increase security. You can do this with the passwd command.
See also  Synology NAS: Automatically import IP blocklists

Accessing your Raspberry Pi via SSH is a convenient way to control and configure your Pi remotely. In just a few steps, you can enable SSH and establish a connection to use the full functionality of your Raspberry Pi. Whether you’re developing projects, installing software or simply performing maintenance tasks, SSH makes managing your Raspberry Pi efficient and easy.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top