i recently got my raspberry pi4 and I forgot the password of my raspberry pi and I don't have any other linux device to reset my password editing cmdline.txt and then booting with a monitor and keyboard attached to run passwd pi, So is there any way I can change my password without linux device?.



1 Answer 1


@Tigron, have you even tried to plug your sd card into another computer? On Windows the boot partition of the Pi is visible without formatting and cmdline.txt is in the boot partition!

  • yeah but I don't think you can reset the password by only changing cmdline.txt
    – Tigron
    Nov 26, 2021 at 19:04
  • Have you done some research online yet? Asking a question on Stack Exchange shouldn't be anyone's first go-to. Here is a webpage from this forum that answers your question: link. In case the link breaks, here are the steps as written by @Xilef: Nov 26, 2021 at 19:13
  • 1
    "Power down and pull the SD card out from your Pi and put it into your computer. Open the file 'cmdline.txt' and add 'init=/bin/sh' to the end. This will cause the machine to boot to single user mode. Put the SD card back in the Pi and boot. When the prompt comes up, type 'su' to log in as root (no password needed). Type "passwd pi" and then follow the prompts to enter a new password. Shut the machine down, then pull the card again and put the cmdline.txt file back the way it was by removing the 'init=/bin/sh' bit." - @Xilef Nov 26, 2021 at 19:13
  • oki ty!, ill try
    – Tigron
    Nov 26, 2021 at 19:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.