What is the SSH password for Raspberry Pi?

If you want to access your Raspberry Pi from a remote computer, you can use SSH and get a terminal as if you were on the Raspberry Pi directly. But, you’ll need the IP address and the SSH password in order to do it. So, what is the default SSH password of the Raspberry Pi?

On the latest version of Raspberry Pi OS, there is no longer a default login and password (it was “pi” and “raspberry”). A setup wizard will start on the first boot to create the main user with your own credentials. In addition, the SSH service is not enabled by default, and need to be activated.

In this article, you’ll learn about other important points on SSH connections to a Raspberry Pi, including
what SSH is, how to enable SSH on a Raspberry Pi, how to make the SSH service start automatically at each reboot, which IP address to use and which port to connect to, and how to log into SSH without having to type a password.

If you’re looking to quickly progress on Raspberry Pi, you can check out my e-book here. It’s a 30-day challenge where you learn one new thing every day until you become a Raspberry Pi expert. The first third of the book teaches you the basics, but the following chapters include projects you can try on your own.

What is SSH?

SSH stands for Secure SHell. It’s a cryptographic network protocol that is mostly used to connect to another computer on a network securely.

In general, SSH will allow you to access the shell (terminal) of your Raspberry Pi from another PC.
This solution can be convenient if you want to install things from your main PC (and copy/paste commands) or even essential if you don’t use a screen with your Raspberry Pi.

In the next paragraphs, we will discuss how to set it up, step by step, starting with the basics, then adding a bit of comfort.

I want to keep this short, but I have an entire article dedicated to SSH on Raspberry Pi, that you can read if you want to know more about this very useful protocol. If you do so, you can probably skip the next sections of this article.

How to connect to Raspberry Pi with SSH?

Note: If you want to see all these steps in action, I have a video lesson available for the community members. You can join here and watch it directly if you are interested (with 10+ other lessons for Raspberry Pi and many other benefits).

From Windows

If you use Microsoft Windows on your main PC, you will probably install and use a third-party tool to use SSH, like Putty for example.
On Windows 11, the ssh command is available in the command prompt, but it’s not that good. Tools are often better.

Putty is one of the most used software programs to access SSH hosts on Windows, and if you start it will be perfect. Download the file matching your computer specifications. And depending on the version chosen, install it or not (there is a portable edition), then launch it.

Download the Pi Glossary!
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!
Download now

Putty looks like this:

puTTy configuration

To log in, type the IP address in the “Host Name” field and click on “Open”.
If you need help finding the current IP address of Raspberry Pi, feel free to read my article on the subject (click on the previous link).

As a reminder, the default SSH login and password on older Raspberry Pi OS versions are:
– Login: pi
– Password: raspberry
On the latest version of Raspberry Pi OS, you created the username and password on the first boot.

If you have changed your Raspberry Pi username and/or password, use the same credentials as when you open your session directly on the Raspberry Pi. And if you don’t remember the one you set, you can use this guide to reset a forgotten password.

If the connection doesn’t work for now, don’t worry. I’ll explain what to do later.

Join Our Community!

Connect, learn, and grow with other Raspberry Pi enthusiasts. Support RaspberryTips and enjoy an ad-free reading experience. Get exclusive monthly video tutorials and many other benefits.

Learn more

From Linux or Mac

If you use a Unix-based system, i.e., any Linux distribution or even macOS, you can use the “ssh” command directly to connect from a terminal.

Depending on your system, you might need to install it. For example, on a distribution based on Debian:
sudo apt-get update
sudo apt-get install ssh

The command to connect to your Raspberry Pi will be something like this:
For example:
ssh pi@

Replace IP with the IP address of your Raspberry Pi. If you need help finding the current IP address of Raspberry Pi, feel free to read my article on the subject.

Type “yes” to confirm the connection the first time. Enter your password, and you’ll be connected to the remote computer.

As a reminder, the default SSH login and password on the Legacy edition of Raspberry Pi OS are:
– Login: pi
– Password: raspberry
On recent versions, you have created a different user and password on the first boot, use this one.

Don’t worry if you can’t connect, I’ll explain why and what to do next.

Are you a bit lost in the Linux command line? Check this article first for the most important commands to remember and a free downloadable cheat sheet so you can have the commands at your fingertips.

How to enable SSH on a Raspberry Pi

As mentioned in the introduction, the SSH protocol is not enabled by default on Raspberry Pi OS (for security reasons).
Whatever the version you use, if you have a desktop environment or not, the first thing you need to do is to enable it.

From the desktop interface

If you have a desktop environment, you need to enable it yourself by going to the main menu > Preferences > Raspberry Pi Configuration.
Go to the “Interfaces” tab and enable SSH:

From a terminal

Same thing from a terminal, you need to start the SSH service manually.
To do this, type the following command:
sudo service ssh start

Download the Pi Glossary!
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!
Download now

You can also check the service status by typing:
sudo service ssh status

By the way, if you want to enable SSH directly on a fresh install, you can check this tutorial on how to do a headless installation (no screen/keyboard required).

How to auto-start SSH on boot?

You will quickly realize that the SSH service, even when enabled manually in the command line, does not start automatically on startup. So, you have to find a way to force it to start.

You have different ways to do this, but in this case, I chose to schedule it in the root crontab on startup:

  1. Edit the root crontab like this:
    sudo crontab -e
  2. Add this line at the end of the file:
    @reboot /usr/sbin/service ssh start

If this is not obvious to you, you can read the tutorial on how to schedule tasks on Raspberry Pi. It explains in detail these notions of cron and crontab, and I even believe that the start of SSH on boot was one of the examples given.

Another option that might be easier for some of you, is to enable it with raspi-config (Interface options > SSH). It will start the service immediately, and also automatically enable it on boot.

Which IP address and port to connect?

By default, the SSH service starts on port 22. You must, therefore, connect to the IP of the Raspberry Pi with port 22.

For example, from Linux:
ssh pi@

Or if you changed the SSH port, specify the port with the -p option:
ssh pi@ -p2222

Replace 2222 with the port chosen.

As mentioned above, if you do not know the current IP address of the Raspberry Pi, do not hesitate to take a look at my post on the subject where I explain how to find it easily. This post will also tell how to set it static, so you do not have to search for it every time you want to log in again.

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now

How to connect SSH without a password

You now know how to activate the SSH service on your Raspberry Pi and how to connect to it.
That’s great, but if you have to do it as often as I do, typing the password every time will quickly become boring.

There is a way to create an SSH key to identify you with it and no longer with the user’s password.
I will explain how to set this up according to your operating system.

Of course, the password connection will still be possible if you lose the key or use another computer.

From Windows

First thing, on Windows you will need the full suite of Putty, with PuttyGen and PuttyAgent.
So if you downloaded only the SSH client in the portable version, you have to install everything.

You will also need a tool to transfer a file to your Raspberry Pi. WinSCP is a good choice.

Then follow these steps:

  1. Create your SSH Keys with PuttyGen:
    1. Start PuttyGen.
    2. Select RSA as the type of key.
    3. Enter 4096 as the number of bits.
    4. Click Generate.
    5. Let all other options by default, no passphrase.
    6. Save the keys where you want.
  2. Transfer the public key to the Raspberry Pi with WinSCP.
    1. Add a new site with our Raspberry Pi IP and credentials.
    2. Connect to this site.
    3. On the left side, go to the folder where you saved your keys.
    4. On the right side, go to the /home/pi folder.
    5. Transfer the public key to the Raspberry (drag & drop).
  3. Allow this key on the Raspberry Pi.
    1. Connect to the Raspberry Pi with Putty.
    2. Add the public keys just transferred to the allowed keys:
      cat /home/pi/your_key.pub >> ~/.ssh/authorized_keys
    3. Close putty.
  4. Try to connect again with Putty.

This test should not require you to type a password and log in directly.

If you still need a login, enter pi@IP in the “Hostname” field by replacing IP with the IP address of the Raspberry Pi. You can also use the name directly if you have set your hostname correctly as explained here.

Note: If you are a premium member in the community, I have an entire lesson about SSH, where I show you how to do this, step-by-step, in a video format. I highly recommend watching it if you can, as it’s way easier to understand with a visual support.

From Linux or Mac

On Linux, the procedure is slightly different, but the steps are the same:

  1. If you don’t already have one, create your SSH keys with this command:
    ssh-keygen -t rsa
    Just press Enter for each question, default path and no password.
  2. Copy the public key file to your Raspberry Pi:
    scp ~/.ssh/id_rsa.pub pi@IP:/home/pi/your_key.pub
    Replace IP with your Raspberry Pi IP address, and name the key as you want.
  3. Add this key to the allowed keys using this command on the Raspberry Pi:
    cat /home/pi/your_key.pub >> ~/.ssh/authorized_keys
  4. Try to connect again :
    ssh pi@admin
    This attempt should not require you to type a password and log in directly.

Here you are, at maximum comfort, to use SSH from this PC.

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now

🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

If you are looking for exclusive tutorials, I post a new course each month, available for premium members only. Join the community to get access to all of them right now!


And that’s it, you now know:
What is SSH?
– How to activate SSH on a Raspberry Pi.
– How to make the SSH service start automatically at each reboot.
– Which IP address and which port to connect to.
– How not to have to type a password to log in to SSH.

You are now ready to tackle more fun projects on your Raspberry Pi, here are a few ideas:

If you have any other questions or are stuck somewhere, do not hesitate to ask for help in the community.

Whenever you’re ready, here are other ways I can help you:

The RaspberryTips Community: If you want to hang out with me and other Raspberry Pi fans, you can join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.

Master your Raspberry Pi in 30 days: If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.

The Raspberry Pi Bootcamp: Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.

Master Python on Raspberry Pi: Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts.

You can also find all my recommendations for tools and hardware on this page.

Similar Posts

One Comment

  1. I tried to connect my laptop to my nes 4pi but was not able to get it to work. Now that I am trying to play on my tv it s saying the password was not changed and that I need to run raspberry pi configuration. however, this was not the case before I tried connecting my laptop. I do I get the system back to normal where I can just plug into my tv, turn it on and start playing?

Comments are closed.