edmiller1966
Posts: 1
Joined: Sun May 01, 2016 11:44 pm

Password Lost

Sun Sep 25, 2016 12:08 am

Help I forgot my password

ejolson
Posts: 3820
Joined: Tue Mar 18, 2014 11:47 am

Re: Password Lost

Sun Sep 25, 2016 3:39 pm

Make sure you don't have caps lock turned on as that makes it difficult to enter a password correctly.

The easiest solution would be to place the sdcard into a card reader on a different computer and clear the password field. Note that Microsoft Windows by default is not able to read Linux formatted cards. One solution would be to format a different sdcard with Raspbian, boot your old Pi with the new card and then plug the USB card reader into the Pi.

After that, the method for clearing the password field is the same as for any other Linux or Unix based system. The idea is to mount the root filesystem from the sdcard, say at /mnt/root, and then edit the file /mnt/root/etc/shadow. Look for the line that contains your username and clear the password field by deleting all the random characters between the two colons. Unmount the card and you're done. Boot the old card in the Pi. When the system prompts for a password, just press the return key. More details can be found by searching the web.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Password Lost

Sun Sep 25, 2016 4:15 pm

edmiller1966 wrote:Password Lost
Funny, I read that as the title of an epic poem in blank verse by the 17th-century English poet John Milton. I suppose not having their password could be why they couldn't get back into Eden.

Of course had Adam and Eve simply provided themselves with another account that was sudoable, they might've used that password to get to some more apples. Failing such a easy solution to their dilemma, mounting the sdcard in another machine and chrooting in might help. The problem though is that people often want to do this on a machine that isn't arm, like their x86 laptop, which won't directly work. You can, however, mount the sdcard and make changes by editing files, perhaps to include booting to single user mode allowing access to root without a password.

Although few people seem inclined, I think that getting a second sdcard, any size at all should be fine, and putting on a memory only linux distribution, e.g. tiny core, booting to that, removing it and mounting the sdcard with the issue and then chrooting to that, doing all that is a good idea. What this should allow you to do is get root and run any reasonable command line program you want, although you probably can't run anything X because tiny core and R. jessie have important differences, I think it's not having systemd stuff and having it that is that problem.

Heater
Posts: 13894
Joined: Tue Jul 17, 2012 3:02 pm

Re: Password Lost

Sun Sep 25, 2016 4:20 pm

Of course you can do this from an x86 laptop or PC. Mine happen to run Debian so I just put the SD card in the card reader and start hacking on whatever files it has in the. In this case /etc/passwd is a good start.

If one does not have a PC/Laptop that is running Linux then perhaps it's time to get one.
Memory in C++ is a leaky abstraction .

ejolson
Posts: 3820
Joined: Tue Mar 18, 2014 11:47 am

Re: Password Lost

Sun Sep 25, 2016 5:18 pm

stderr wrote:Of course had Adam and Eve simply provided themselves with another account that was sudoable, they might've used that password to get to some more apples.
Eating the forbidden fruit represents a transition from the child who obeys a parent's rules to one that changes the rules and decides what's right and wrong on their own. Once grown up, it is never possible to return to childhood. At the same time, all good parents want their children to grow up. That is why eating the fruit, even though forbidden, was part of the plan. The consequences of making decisions sometimes results in great good and other times in lost passwords. With a bit of editing the lost password will be cleansed, a new password will be born and your system will have new life.

Graymalk
Posts: 55
Joined: Wed Nov 11, 2015 8:33 pm

Re: Password Lost

Mon Sep 26, 2016 12:54 am

Funny story: I went through all the rigamarole of mounting the root filesystem and changing the password only to continue to fail to log in. Keyboard was still set to GB and I had decided not to ssh for some reason so it got me. Oops.

Return to “General discussion”