How to Reset Raspberry Pi Password?

Share This:

Raspberry Pi is a popular single-board computer that is widely used by hobbyists, enthusiasts, and professionals. It is a versatile device that can be used for a variety of applications, including gaming, web browsing, media playback, and more. However, like any other computer, Raspberry Pi can also be vulnerable to security threats such as password hacking. In this article, we will discuss how to reset the Raspberry Pi password in case you forget it or suspect that it has been compromised.

The default login credentials for Raspberry Pi are username: “pi” and password: “raspberry”. It is highly recommended that you change these default credentials as soon as possible. To do so, log in to your Raspberry Pi and open the command line. Type “passwd” and hit Enter. You will be prompted to enter your current password, followed by your new password. Make sure that your new password is strong and secure, containing a mix of uppercase and lowercase letters, numbers, and symbols.

But what if you forget your password or suspect that it has been compromised? In such a scenario, you can reset the password by accessing the root user account. To do so, you need to edit the cmdline.txt file on the boot partition of your Raspberry Pi’s SD card. Here are the steps:

1. Turn off your Raspberry Pi and remove the SD card.
2. Insert the SD card into your computer and open the boot partition.
3. Locate the cmdline.txt file and open it in a text editor.
4. Add “init=/bin/sh” to the end of the line, without quotes.
5. Save the file and eject the SD card.
6. Reinsert the SD card into your Raspberry Pi and turn it on.

Your Raspberry Pi will now boot into single-user mode, with root privileges. You will be presented with a command prompt, where you can reset the password by typing “passwd pi” and hitting Enter. Follow the prompts to enter a new password. Once you have reset the password, type “sync” and hit Enter to save the changes. Then type “reboot -f” and hit Enter to reboot your Raspberry Pi.

Resetting the Raspberry Pi password is a straightforward process that can be done by following the steps outlined above. It is important to remember to change your password regularly and to choose a strong and secure password that is difficult to guess or crack. By taking these simple steps, you can help to ensure the security of your Raspberry Pi and protect your data from unauthorized access.

How to Reset Raspberry Pi Password? 1

Finding Raspberry Pi Username and Password

To find your Raspberry Pi username and password, you can use the default credentials provided by the operating system. The default username for Raspberry Pi is “pi”, which is the same for all devices running the Raspbian operating system. The default password for Raspberry Pi is “raspberry”.

To log in, you can use these credentials and access the terminal interface. However, it is highly recommended that you change the default password for security reasons. To change your password, open the terminal and type “passwd” followed by the “Enter” key. You will be prompted to enter the current password, and then you can set a new password of your choice.

It is important to note that if you have changed your username or password previously, you will need to use those credentials to log in. If you have forgotten your username or password, you may need to reset your Raspberry Pi to its default settings.

The default username for Raspberry Pi is “pi” and the default password is “raspberry”. You can change your password using the “passwd” command in the terminal.

Changing the Raspberry Pi Password

To change the password on your Raspberry Pi, you will need to log in as the root user. Here are the steps you need to follow:

1. Boot up your Raspberry Pi and log in as the root user.

2. Open the command line interface.

3. Use the sudo command to access the account as a supervisor. Type in “sudo su” and press Enter.

4. Once you have logged in as the supervisor, type in the command “passwd root” and press Enter.

5. The system will prompt you to enter your new password. Make sure to choose a strong password that is not easy to guess.

6. You will also need to confirm your new password by typing it in again.

7. Once you have entered your new password, press Enter.

8. The system will confirm that your password has been changed. You can now log out of the root account and log back in with your new password.

It is important to remember that changing your Raspberry Pi password is an important security measure. Make sure to choose a strong password and keep it safe.

Forgetting Your Raspberry Pi Password

If you forget your Raspberry Pi password, you will need to reset it in order to regain access to your system. There are several ways to do this, but one common method is to remove the SD card from your Pi and insert it into another computer. From there, you can edit the Pi’s configuration files to reset the password. Alternatively, you can use a tool like “chntpw” to reset the password directly from the Pi’s command line. It’s important to note that resetting the password will not affect any of your data or settings on the Pi, so you can safely regain access to your system without losing any important data. To avoid forgetting your password in the future, it’s a good idea to choose a strong, memorable password and write it down somewhere safe or use a password manager.

Finding the Raspberry Pi Root Password

To find your Raspberry Pi root password, you can try the following steps:

1. Open the terminal on your Raspberry Pi.

2. Type the command “sudo su” and press enter. This will switch you to the root user.

3. If prompted, enter your current user password.

4. Once you are logged in as root, you can change the root password by typing the command “passwd” and pressing enter.

5. Follow the prompts to enter and confirm your new root password.

Alternatively, if you have forgotten your root password and cannot log in, you can reset it by following these steps:

1. Power off your Raspberry Pi.

2. Remove the SD card from your Raspberry Pi and insert it into a computer.

3. Open the “cmdline.txt” file on the SD card and add “init=/bin/sh” at the end of the line.

4. Save the file and eject the SD card from the computer.

5. Insert the SD card back into the Raspberry Pi and power it on.

6. Wait for the Raspberry Pi to boot into the command line.

7. Type “passwd” to change the root password.

8. Once you have entered and confirmed your new password, type “sync” and press enter.

9. Power off the Raspberry Pi, remove the SD card, remove the “init=/bin/sh” from the “cmdline.txt” file and save it.

10. Reinsert the SD card into the Raspberry Pi and power it on. You should now be able to log in as root with your new password.


Raspberry Pi is an incredibly versatile and powerful single-board computer that has revolutionized the world of computing. It has opened up a whole new world of possibilities for hobbyists, educators, and professionals looking to design and develop innovative projects. With its low cost, small size, and impressive processing power, Raspberry Pi is an ideal choice for anyone looking to experiment and learn about programming, electronics, and robotics. Whether you’re interested in building your own media center, creating a smart home automation system, or developing your own IoT devices, Raspberry Pi offers endless possibilities. With its widespread popularity and active community, you can easily find tutorials, resources, and support to help you get started on your next project. Raspberry Pi is a game-changing technology that has transformed the way we approach computing and has the potential to shape the future of technology.

Share This:
Photo of author

James Walker

James Walker has a deep passion for technology and is our in-house enthusiastic editor. He graduated from the School of Journalism and Mass Communication, and loves to test the latest gadgets and play with older software (something we’re still trying to figure out about himself). Hailing from Iowa, United States, James loves cats and is an avid hiker in his free time.