How to SSH into a Raspberry Pi [Beginner's Tip] (2024)

How to SSH into a Raspberry Pi [Beginner's Tip] (1)

Out of all the things you can do with Raspberry Pi, using it as a server in a home network is very popular. The tiny footprint and low power consumption makes it a perfect device to run light weight servers.

One of the things you should be able to do in such a case is run commands on your Raspberry Pi without needing to plug in a display, keyboard, mouse and having to move yourself to the location of your Raspberry Pi each time.

You achieve this by logging into your Raspberry Pi via SSH (Secure Shell) from any other computer, your laptop, desktop or even your phone. Let me show you how

How to SSH into Raspberry Pi

I assume that you are running Raspbian on your Pi and have successfully connected to a network via Ethernet or WiFi. It’s important that your Raspberry Pi is connected to a network otherwise you won’t be able to connect to it via SSH (sorry for stating the obvious).

Step 1: Enable SSH on Raspberry Pi

SSH is disabled by default in Raspberry Pi, hence you’ll have to enable it when you turn on the Pi after a fresh installation of Raspbian.

First go to the Raspberry Pi configuration window by navigating through the menu.

How to SSH into a Raspberry Pi [Beginner's Tip] (2)

Now, go to the interfaces tab, enable SSH and restart your Pi.

How to SSH into a Raspberry Pi [Beginner's Tip] (3)

You can also enable SSH without via the terminal. Just enter the command sudo raspi-config and then go to Advanced Options to enable SSH.

How to SSH into a Raspberry Pi [Beginner's Tip] (4)

Pironman 5 Case With Tower Cooler and Fan

This dope Raspberry Pi 5 case has a tower cooler and dual RGB fans to keep the device cool. It also extends your Pi 5 with M.2 SSD slot and 2 standard HDMI ports.

Explore Pironman 5

Step 2. Find the IP Address of Raspberry Pi

In most cases your Raspberry Pi will be assigned a local IP address which looks like 192.168.x.x or 10.x.x.x. You can use various Linux commands to find the IP address.

I am using the good old ifconfig command here but you can also use ip address.

ifconfig
How to SSH into a Raspberry Pi [Beginner's Tip] (5)

This command shows all the list of active network adapters and their configuration. The first entry(eth0) shows IP address as 192.168.2.105 which is valid.I have used Ethernet to connect my Raspberry Pi to the network, hence it is under eth0. If you use WiFi check under the entry named ‘wlan0‘ .

You can also find out the IP address by other means like checking the network devices list on your router/modem.

Step 3. SSH into your Raspberry Pi

Now that you have enabled SSH and found out your IP address you can go ahead and SSH into your Raspberry Pi from any other computer. You’ll also need the username and the password for the Raspberry Pi.

The default username and password is:

  • username: pi
  • password: raspberry

If you have changed the default password then use the new password instead of the above. Ideally you must change the default password. In the past, a malware infected thousands of Raspberry Pi devices that were using the default username and password.

Open a terminal (on Mac and Linux) on the computer from which you want to SSH into your Pi and type the command below. On Windows, you can use a SSH client like Putty.

Here, use the IP address you found out in the previous step.

ssh [emailprotected]

📋

Make sure your Raspberry Pi and the computer you are using to SSH into your Raspberry Pi are connected to the same network.

How to SSH into a Raspberry Pi [Beginner's Tip] (6)

You’ll see a warning the first time, type yes and press enter.

How to SSH into a Raspberry Pi [Beginner's Tip] (7)

Now, type in the password and press enter.

How to SSH into a Raspberry Pi [Beginner's Tip] (8)

On a successful login you’ll be presented with the terminal of your Raspberry Pi. Now you can any commands on your Raspberry Pi through this terminal remotely(within the current network) without having to access your Raspberry Pi physically.

Furthermore, you can also set up SSH-Keys so that you don’t have to type in the password every time you log in via SSH, but that’s a different topic altogether.

I hope you were able to SSH into your Raspberry Pi after following this tutorial. Let me know how you plan to use your Raspberry Pi in the comments below!

About the author

Chinmay

I'm a Maker, love to tinker with electronics. PCMR fanatic and I occasionally make YouTube videos about tech.Philosophy and Psychology are my interests on the other side of the isle.

    How to SSH into a Raspberry Pi [Beginner's Tip] (2024)

    FAQs

    How to SSH into a Raspberry Pi [Beginner's Tip]? ›

    First go to the Raspberry Pi configuration window by navigating through the menu. Now, go to the interfaces tab, enable SSH and restart your Pi. You can also enable SSH without via the terminal. Just enter the command sudo raspi-config and then go to Advanced Options to enable SSH.

    How to SSH into Raspberry Pi first time? ›

    1. Open the Raspberry Pi Terminal.
    2. Enter the command: sudo raspi-config.
    3. Use the arrow keys to navigate to Interfacing Options. Press the Enter key.
    4. Go to SSH, and press enter.
    5. When prompted, select <Yes>.
    6. Select Enter to confirm, then click Finish to exit raspi-config.
    7. Close the terminal window.
    Aug 1, 2023

    How to SSH into Raspberry Pi using PuTTY? ›

    Step 2 Connecting to your Pi via SSH
    1. Download and install PuTTY.
    2. Enter the IP address from the last step in the Host Name box. Ensure that SSH is selected.
    3. Click Open.
    4. When prompted to accept the certificate, click yes. It will come up as a PuTTY Security Alert.
    5. Login with username pi.
    6. Use password "raspberry".

    How do I enable SSH on my Raspberry Pi remotely? ›

    Before you can remotely access your Raspberry Pi, you need to ensure SSH is enabled:
    1. Connect your Raspberry Pi to a monitor and a keyboard.
    2. Open the terminal from the desktop.
    3. Enter sudo raspi-config in the terminal.
    4. Navigate to 'Interfacing Options', then 'SSH', and select 'Enable'.
    5. Exit the configuration tool.

    How to use SSH keys Raspberry Pi? ›

    Setting up key-pair ssh on Raspberry Pi
    1. Generate private/public key pair on the client. There are multiple tools and libraries that facilitate key-pair generation. ...
    2. Copy the generated public key to the RPi. ssh-copy-id -i ~/.ssh/rpi_rsa.pub <RPi_USER>@<RPi_IP> ...
    3. Secure SSH into the server.
    Feb 20, 2024

    How to access Raspberry Pi for the first time? ›

    Booting Your Raspberry Pi for the First Time
    1. Insert the microSD card into the Raspberry Pi.
    2. Connect the Raspberry Pi to a monitor, keyboard and mouse.
    3. Connect an Ethernet cable if you plan to use wired Internet.
    4. Plug the Pi in to power it on.
    Sep 21, 2022

    What is the initial password for SSH in Raspberry Pi? ›

    The default password is raspberry. The characters do not display when typing in the password. Make sure to input the correct password. We now get the Raspberry Pi connected and are ready to go to the next step.

    How to access Raspberry Pi terminal? ›

    To open a terminal window, click on the Terminal icon at the top of the screen, or select Accessories and then Terminal in the menu. You should see the following prompt, although the exact prompt will show the username you have chosen.

    How to connect to Raspberry Pi? ›

    Use a cable to connect the screen to the Raspberry Pi's HDMI port — use an adapter if necessary. Connect your screen to the first of Raspberry Pi 4's HDMI ports, labelled HDMI0. You could connect an optional second screen in the same way. Connect your screen to the single HDMI port.

    How do I SSH into a device using PuTTY? ›

    Launch PuTTY on a Windows workstation and type the destination IP address in the HOST Name (or IP address) box. Ensure SSH is selected from the Connection type radio options. Click Open. The remote Linux system will prompt you for the name and password of a local user account.

    How to enable SSH in Raspberry Pi without monitor? ›

    If you use your Raspberry Pi without a monitor and keyboard, then the only way to enable SSH in headless mode is to use a blank boot file. For this task, you need to create an empty ssh file on another machine. We will use this file on the Raspbian boot SD card to enable SSH.

    What is the default IP address of a Raspberry Pi? ›

    After the IP setting is confirmed, you can enter the default IP of the Raspberry Pi: 192.168. 0.100 in the web address bar in the computer browser, and you can directly access the Raspberry Pi running backstage and change the information. The above are the three ways to access the Raspberry Pi IP correctly.

    What is the hostname of Raspberry Pi? ›

    It should have the hostname “raspberrypi”. If you cannot find the IP address of the Pi, on some networks the hostname may be available. Open a console or terminal, and try and ping the hostname. If you see a positive response, you can just use the hostname on this network.

    How do I start SSH on my Raspberry Pi? ›

    Enable ssh directly on the SD card

    Still in the root folder of your SD card (“boot”) create a new file named “ssh”, with no extension. That's it! This will enable ssh when you boot the Pi. Now, remove the micro SD card from your computer, make sure the Pi is powered off, put the SD card into the Pi, and power it on.

    How to SSH into desktop Raspberry Pi? ›

    SSH service is not enabled by default in Raspberry Pi. To enable SSH, access command line using sudo raspi-config command). Since there is no monitor or keyboard connected to Raspberry Pi, it is not possible to use $ ifconfig command. To find out the IP address assigned to Raspberry Pi using a laptop, use nmap tool.

    How to access Raspberry Pi from laptop? ›

    If your laptop has an ethernet port , attach the ethernet cable between that laptop ethernet port and the Pi's ethernet port. If your laptop doesn't have an ethernet port , connect the USB-to-ethernet dongle to a USB port on your laptop, then attach the ethernet cable between that dongle to the Pi's ethernet port.

    How to start SSH session? ›

    You can start an SSH session in your command prompt by executing ssh user@machine and you will be prompted to enter your password. You can create a Windows Terminal profile that does this on startup by adding the commandline setting to a profile in your settings.json file inside the list of profile objects.

    How to boot to command line and SSH on Raspberry Pi? ›

    To do this, run the raspi-config command as before, and in the config menu that loads, select “Interfacing Options”. In the list that loads, select the line with “P2 SSH”. The menu will prompt you if you want to enable SSH or not; select “Yes”. Next, you need to find out your Raspberry Pi's IP address.

    How to transfer files to Raspberry Pi through SSH? ›

    The simplest way is to use Secure CoPy from a Terminal Window (see also “Article on Using SSH On A Mac”). Open a terminal window and use the following command: scp pi@<IP Address of Raspberry Pi>:<Path to File> . Using a “.” at the end copies it to your current directory (you can find this out by typing “pwd”).

    Top Articles
    Latest Posts
    Recommended Articles
    Article information

    Author: Terrell Hackett

    Last Updated:

    Views: 5543

    Rating: 4.1 / 5 (72 voted)

    Reviews: 95% of readers found this page helpful

    Author information

    Name: Terrell Hackett

    Birthday: 1992-03-17

    Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

    Phone: +21811810803470

    Job: Chief Representative

    Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

    Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.