Thursday, May 2, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 3541  / 3 Years ago, thu, august 26, 2021, 6:05:01

I have an RPi that I have forgotten the password to. I have history on the ubuntu command line on my PC of ssh logins and I was hoping there would be a way to get text history entered into to try to find my password. If not is there a way to recover an RPi password? I am running Ubuntu Server (not Raspbian) and was unable to access GRUB.


Earlier I was using the history command but that only shows the ssh commands and not the details entered in.


Any help would be massively appreciated!


EDIT - Some solutions don't work because they are for the Raspberry Pi 3B and below and I have a Raspberry Pi 4B


EDIT - I have found a solution thanks to a friend of mine, I will put an answer below. Thanks to everyone who helped me :)


More From » command-line

 Answers
1

To solve this issue I took the SD card out of the pi and opened it in another linux machine.


In the terminal I used the command below to remove the "x" from the root user line


sudo nano /mnt/sdcard/etc/passwd

(You may need to mount the SD card or USB stick reading the SD card)


Then I was able to put the SD card back into the pi and log in to the root user without typing a password.


Finally I could create a new password using the passwd command.


[#1262] Friday, August 27, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bewre

Total Points: 164
Total Questions: 108
Total Answers: 106

Location: Ghana
Member since Sun, Mar 27, 2022
2 Years ago
bewre questions
Sun, May 14, 23, 13:27, 1 Year ago
Mon, Aug 2, 21, 03:57, 3 Years ago
Sat, Aug 6, 22, 21:41, 2 Years ago
Sat, Jul 24, 21, 22:52, 3 Years ago
Sun, Mar 12, 23, 04:23, 1 Year ago
;