How to reset the Raspberry Pi password

Raspberry Pi

El Raspberry Pi It is a small device that has quickly become one of the favorites of hardware enthusiasts, who see in this small card-sized computer the possibility of reaching all kinds of projects. As those who know him a little know well (and as we can see in the download section of your website) we can use some Linux distributions, such as Debian (Raspbian), Fedora (Pidora), Arch Linux or even variants of XBMC (Raspbmc).

Now, if we forget the login password, we are in trouble as it would happen to us in any case with our computer, and we will have to try some procedure to be able to enter. Let's see then how to restore the password of our Raspberry Pi if we have forgotten it, to avoid losing all the information or data that we have saved in memory when having to format to use it again.

To begin, we have to remove the SD card from the Raspberry Pi, insert it into our computer and open the preferred file explorer. In the root directory we will see a file called cmdline.txt, which we open for editing through our preferred editor (Nano, Gedit, etc.) and add the following at the end of it:


We save the file, unmount the card and insert it back into the Raspberry Pi; we start the device and when we do we will see a blinking cursor. At that time we enter the following:

passwd pi

After which we write our password and enter Enter twice. Now we have to execute the following command:

sync exec /sbin/init

We will see that our Raspberry Pi restarts, and once this process is finished we must turn it off to remove the SD card again and take it back to our computer. We reopen the file to remove the line that we added at the beginning (init = / bin / sh) and with a last restart we will have left everything in order.

The content of the article adheres to our principles of editorial ethics. To report an error click here.

2 comments, leave yours

Leave a Comment

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



  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Gisela said

    I was lent me a raspberry and I did not give the login or password

  2.   Jorge Alexander said

    How to do it if I have Ubuntu mate 18.04 installed, I don't know why the password was changed after making the corresponding updates, my password didn't work anymore, I follow these steps but it starts without letting me write.