raspberry pi reset the password (Brief Answer)
We research and review everything that we share and recommend on our blog and try to keep things up to date. When you buy something through our links we may earn a commission. Learn more about our affiliate disclosure and about us.
You can use the raspberry pi to reset password to explore new technologies and improve your computing abilities. You’ll use a command line to change your Raspberry Pi’s password. The first step is to turn off your smartphone. The next step is to access your physical SD card, which is necessary for finishing the procedure, and connect it to your laptop or desktop so that you may make the necessary adjustments. You can use many command lines depending on the account you are resetting. It would help if you used Wi-Fi or an Ethernet cable to connect to the internet while resetting.

Helping computer enthusiasts develop their coding skills has grown to be very popular. However, you can be in danger if you’ve logged out of your account and can’t recall your password. That’s because passwords and usernames are kept in a way that makes it challenging to recover them. However, there are a couple more ways to log in, so you’re not completely out of luck.
How to fix the raspberry pi reset password?
Resetting The Raspberry Pi Password For NOOBs
The NOOBs also allow you to reset the password using alternative procedures than those previously outlined.
To do this:
- Press the Shift key while the system is starting up to start the system in recovery mode.
- Click on Edit config after selecting your Raspbian image (e).
- Select the cmdline.txt tab and add the command line parameter init-/bin/sh.
- To restart the system, press Ok.

Press Enter to see a line with the number 1 when the system restarts.
- In this box, type:
- / mount -o remount
- pi password
- Your new password will need to be entered at this point.
- Enter sync after changing the password:
- Afterward, type exec /bin/init
- Repeat the procedure now, but this time removes the init=/bin/sh line.
Note: The new password will appear in ***** when you type it. You won’t be able to use your new password if you don’t carefully check for mistakes.
Reset The Password By Removing The SD Card:
You can reset your password using this technique without contacting Raspberry Pi support. It’s really simple, but some hardware work is necessary. Please be aware that this approach also needs physical access to the Raspberry Pi and its SD card, much like the way described above. In addition, a monitor, an additional PC with a microSD reader, and Pi Zero adapters are required.
The SD card for the Raspberry Pi must first be removed and placed inside your PC. You must shut down Raspberry Pi before removing the microSD card, which is impossible if it is not plugged into a monitor.
Then you ought to unplug it. Look for a file named cmdline.txt in the root directory by opening the file explorer, opening the memory card file, and then doing so. Use one of the text editors you have installed to copy and paste the following command at the end of the text in the file, making sure everything is on one line:
init=/bin/sh
Unmount the SD card after saving the file. Put it into the Raspberry Pi now, and when you switch it on, you’ll see a blinking cursor in single-user mode. Remember that a keyboard and monitor should be connected to the Raspberry Pi.
A sequence of command lines will scroll swiftly before stopping, allowing you to enter new ones. You must unmount and remount the root if logged in as root. In the window, type mount -o remount, rw / After the flashing cursor, type su and then enter the command shown below in the window:
init=/bin/sh:
- Unmount the SD card after saving the file.
- Put it into the Raspberry Pi now, and when you switch it on, you’ll see a blinking cursor in single-user mode.
- Remember that a keyboard and monitor should be connected to the Raspberry Pi.
- A sequence of command lines will scroll swiftly before stopping, allowing you to enter new ones.
- You must unmount and remount the root if logged in as root.
- In the window, type mount -o remount, rw /
- After the flashing cursor, type su and then enter the command shown below in the window:
pi password:
- You must enter your new password and hit Enter twice at this point.
- In the newly opened window, type sync exec /bin/init.
- With this command, Raspberry Pi will restart while retaining your data in memory.
- Turn the computer off, take out the SD card, then put it back in after the system has rebooted.
- To return to the default settings, reopen cmdline.txt and remove the line that reads “init = / bin / sh.”
- The following command should be entered if you want to modify the pi user’s password:
- Password: pi
- If not, you’ll modify the root password.
Eliminate The Need For A Password:
You can modify the settings another way so that Raspberry Pi no longer asks you for a password. After that, you can use the command line to access the system and modify your password. For this method to work, the SD card must first be unmounted before being connected to a Linux, Windows, or macOS computer.
The file explorer appears on the window when you insert the SD card. Check for /etc/passwd and edit it. You ought to stare for a line that starts with pi: x: 1000:100 and remove the x, leaving the two colons.
The change will do away with the requirement for a password. Reinstall the SD card into the Raspberry Pi, unmount it, and log in as usual. Use the passwd command to modify your credentials after that.
Reset The Password Via Commands:
The passwords are stored in /etc/passwd on Linux. If you’ve forgotten it, there is no way to access this file and view your password. So, changing your password is the best option to get your data back. Nevertheless, the approaches for changing a password vary according to whether you can access your account or not.
For instance, if you haven’t already changed your password, you can log in using your default username and password. You can log in without entering a password if you have a user with Sudo privileges. Enter the following command to get started.
sudo passwd:
Without asking for your current password, this command will ask you for a new one. Another choice is to sign in using the startup configuration. Sudo raspi-config is entered in a terminal window after it is open. The Change User Password option can be found on the menu displayed when you issue this command.
How Do I Reset My Raspberry Pi Password Without a Monitor?
Most raspberry pi password resets assume the user has a monitor, but these units lack a keyboard and monitor. This can be not easy when you want to set up your device, but I’ll show you how to get around without a monitor and reset your password. If you want to reset your Raspberry Pi without a monitor, you’ll need an SD card reader, another computer with internet connectivity, and root access. Additionally, you will want access to the router and an Ethernet cable to connect to the internet.
Start by turning off your Raspberry Pi and removing the SD card. The SD card should then be inserted into the machine on which you have root access. The card needs to be 8GB or larger to maximize your Pi’s performance. Editing the etc/shadow is where you should begin. To accommodate the change, this modifies the account password. To avoid confusion, it is best to edit this file on the root computer rather than your own.

Once you’ve done that, locate the line that starts with Pi and change the text to OpenSSL passwd -1 -salt> passwd>. Use the password hash $1$salty$SzJsU4qDcXp536Acnlp6I as an alternative. The Pi will start once you remove the SD card and put it in.
The last step is to connect through SSH to your Pi. When your Pi reads this, it will instantly enable SSH and provide you remote access to the Pi command line from your PC. You may reach the Pi command line from your PC by enabling SSH. You will need to establish a connection to the internet to carry out this even after enabling SSH, which makes it simpler for you to log in and issue terminal commands. Through Ethernet, USB, or Wi-Fi, you can access the internet.
You are making a WPA supplicant. Conf text file and storing it in the Micro USD root directory is the first step in using Wi-Fi to access the internet on your Raspberry Pi. If you reside in the UK, update the country setting to GB; otherwise, enter the appropriate code and your SSID and password. Your Pi will log you into that network when it starts up. If Ethernet is being used, you can reach your Pi by name without making any changes to the files.
Only Pi Zero and Zero W owners can connect via a USB cable. This approach is practical because it is location-independent. To begin the connection, open the config.txt file located in the root directory of your micro SD card, and then add dtiverlay=dwc2 to the bottom of the file. Add modules-load=dwc2,g ether to the command line after that. Then save the text after root wait. You must install Apple’s Bonjour Print Services for your PC to see the Pi. The USB will then be connected to the USB port.
You’ll need an SSH connection once you’ve used one of the methods above to connect your Pi to the internet. Install Putty first, then type raspberry. Local into the Host Name field Click Open after that to approve the connection.
A security warning will appear on your initial try to connect; since you are connected to your Pi, you should select Yes to accept. If the SSH connection attempt is successful, your Raspberry Pi will prompt you to log in. You can either use the preset passwords or modify them to log in. Run the sudo passwd pi command to change the password, then type the one you made with the hash.
Final words:
It’s unavoidable to forget a system password, especially if you have too many passwords to remember. You don’t need to freak out or call for help if you forget your raspberry password in the future. Instead, you can raspberry pi reset password the system in the comfort of your own home and regain access. For security concerns, you should also change your default pi credentials the first time you enter the system in addition to your forgotten password.
People Also Ask
What do I do if I forget my pi password?
Please change your password here: Turn off the Pi, remove the SD card, and insert it into your computer. Launch the “cmd line” file. Reinstall the SD card in the Pi, then start it up. Type “su” to log in as root at the prompt (no password needed) To set a new password type passwd pi and adhere to the on-screen instructions.
How do I find my Raspberry Pi username and password?
Raspberry and Pi are the standard login and password, respectively. Use the passwd command to modify your password right away after logging in. Passwd should be entered into the command line after it is opened. Your current password will be required for verification.
How do I factory reset my Raspberry Pi?
Unfortunately, there is no option to return the Raspberry Pi to its factory default settings, which would be comparable to when it was first installed. The SD card or USB drive to store data must be taken out and formatted to reset the device.
Who is the default user in Raspberry Pi?
Since its release, the Raspberry Pi OS (and the majority of operating systems based on it) have included a default “pi” user account, making it easier to boot up a Pi and get to work without having to connect it to a monitor or go through a laborious setup procedure.

Marie Ocmer is a freelance writer and a senior editor in a Philippines news company. She’s writing about computers for a decade and has developed software and worked for UI/UX, for high-tech industries of the latest times. She has covered topics related to data, networks, cyber security, and how technology has emerged and entertained us in movies with AI and robotics can affect humans life and in the medical field.