pgielen
Posts: 9
Joined: Sun Feb 24, 2019 6:47 pm

Raspberry Pi keeps forgetting passwords

Sun Feb 24, 2019 6:55 pm

There is something seriously wrong with the way Raspberry Pi saves passwords. If I change the default password (raspberry) for user 'pi', then, after a random period of time, the RPi will change the new password by itself into something unknown. Logging in is impossible after that, so the only option I have is to delete the entire system and manually reinstall everything that was on the SD. Of course, not changing the password for pi is not an option, since this leaves the system wide open for hackers.

I have tried the method described in several places on the internet to reset the password for pi (adding init=/bin/sh to cmdline.txt on another computer, login on the pi with su and set the new password for pi). That doesn't work. After logging in as root and changing the password, it just tells me that the password is unchanged. After deleting the modifications in cmdline.txt and rebooting, I still can't login.

Having to completely reinstall everything time after time makes the RPi unusable for serious applications in my opinion. So, is there another way to restore normal access to the system?

:?

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi keeps forgetting passwords

Mon Feb 25, 2019 3:27 am

The password is stored on your SDCard. If your RPi fails to store a new password across a reboot then your SDCard is worn out (end-of-life) and should be replaced.

Get a new SDCard and use the cloning tool to copy your dead card to the new one.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
HawaiianPi
Posts: 5711
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi keeps forgetting passwords

Mon Feb 25, 2019 10:23 am

pgielen wrote:
Sun Feb 24, 2019 6:55 pm
There is something seriously wrong with the way Raspberry Pi saves passwords. If I change the default password (raspberry) for user 'pi', then, after a random period of time, the RPi will change the new password by itself into something unknown.
Actually, there is something seriously wrong with your system. I've been using Raspberry Pi computers for many years (since the R2 model B in late 2012) and I have NEVER had a password change on it's own with any version of Raspbian, or any other OS that I've tried. I've also been using various versions of Linux as my primary OS for almost two decades, and I've never had that happen on any version of Linux on any computer.

Whatever your problem is, it has nothing to do with Raspbian or Linux in general. So why don't you give us details about how you configure and use your system so that we can try and figure out what is failing. The more details your offer, the more quickly we'll get the to bottom of this.

As I see it there are two main possibilities.
  1. The password is getting changed, which would involve another person (they don't change themselves).
  2. The password isn't getting changed, but something else is failing and preventing login.

Option #1 could be someone else messing with your system, or something you are doing with software (like using sudo in /home/pi).

Option #2 could be a hardware failure, or just improper operation (bad or inadequate power supply, bad SD card, not shutting down before disconnecting power).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

pgielen
Posts: 9
Joined: Sun Feb 24, 2019 6:47 pm

Re: Raspberry Pi keeps forgetting passwords

Tue Feb 26, 2019 9:07 am

First of all, this happened to me on several occasions on all of the three RPi's I have (two 3B+ models and one Zero W) , with different SD cards. On all systems, Raspbian Stretch (latest version) was installed. On all three however, I saw some undervoltage warnings with several power supplies I have tested. So now, I have ordered a new official Raspberry Pi power supply to test if this will solve my problems.

User avatar
RaTTuS
Posts: 10558
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Raspberry Pi keeps forgetting passwords

Tue Feb 26, 2019 9:57 am

do you have these connected to the internet so you can remote log into them
have you open ports on your router to the RPi's
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

pgielen
Posts: 9
Joined: Sun Feb 24, 2019 6:47 pm

Re: Raspberry Pi keeps forgetting passwords

Thu Mar 07, 2019 2:16 pm

RaTTuS wrote:
Tue Feb 26, 2019 9:57 am
do you have these connected to the internet so you can remote log into them
have you open ports on your router to the RPi's
Yes I have, because I run Domoticz on this RPi, ports 8080 to 8089 are open. Everything seems stable for a week or so after I started using an official power supply (at least the undervoltage warnings disappeared). So I keep my fingers crossed.

andrum99
Posts: 1207
Joined: Fri Jul 20, 2012 2:41 pm

Re: Raspberry Pi keeps forgetting passwords

Thu Mar 07, 2019 5:26 pm

It sounds like a weak power supply was causing the passwords to get corrupted. You should be fine with the official power supply.

pgielen
Posts: 9
Joined: Sun Feb 24, 2019 6:47 pm

Re: Raspberry Pi keeps forgetting passwords

Sat Mar 16, 2019 8:51 pm

Yes, I never imagined that usb phone chargers could be the culprit, since the RPi, even when warning about undervoltage, still runs on them. My system has never been more stable since I bought an official power supply, so I guess I owe you all an apology for my nasty message. I am now going to buy official power supplies for all my RPi's and will start having some real fun with them :D

andrum99
Posts: 1207
Joined: Fri Jul 20, 2012 2:41 pm

Re: Raspberry Pi keeps forgetting passwords

Sun Mar 17, 2019 11:47 am

pgielen wrote:
Sat Mar 16, 2019 8:51 pm
Yes, I never imagined that usb phone chargers could be the culprit
Problems with power supplies are quite common - that's why we now have an official power supply.

The "lightning bolt" means there is an undervoltage detected, which is likely to cause problems. A lack of "lightning bolt" does not necessarily mean everything is OK, as you've discovered.

Glad you got it sorted. :D

Return to “Troubleshooting”