-1

I am newbee at Pi3B. I installed Jessie at Pi3B board.

Whenever I reboot the board, the pi's password was changed into unknown value. So, I delete pi's password encryption field from /etc/password everytime and reset the password. Then the password remains until I reboot. This is stupid. Can anyone tell me what is wrong on the password ?

P.S. I found similar questions in this forum. But, no answers found yet. I am not using WiFi and my ssh and internet work well after I reset the password.

To change the password for pi, I simply used $passwd command. It seems work well. About the password, user-entered passwod is eventually encrypted and wrote onto the /etc/password file. I tried raspi-config to change pi's password, but, still the same problem.

88weighed
  • 905
  • 6
  • 17
Totoro
  • 7
  • 1
  • 3
  • have you changed it in terminal using passwd ? – Dr.Rabbit Oct 08 '17 at 05:55
  • yes. After the change, it remains until I reboot the system. – Totoro Oct 08 '17 at 06:09
  • Oh, after reboot, I directly remove the password field of /etc/password file and then ran passwd command. – Totoro Oct 08 '17 at 06:10
  • HOW are you attempting to change the password? List the EXACT command entered. Is there any reason you are not using raspi-config to change the password? NOTE the password is NOT stored in /etc/password – Milliways Oct 08 '17 at 06:41
  • 1
    @Totoro DO NOT add detail in comments, edit your question. You need to explain what you mean by "delete pi's password from /etc/password" – Milliways Oct 08 '17 at 07:14
  • OK. I updated my question.... – Totoro Oct 08 '17 at 11:05
  • 1
    @Milliways: The password is not stored anywhere, of course, but it is possible to delete a field in /etc/passwd and make the account passwordless. Also, a hash of the password (== a one-way encrytion) will appear in that field after you set one, until pwconv is run, at which point it will be replaced with an x. – goldilocks Oct 08 '17 at 14:12
  • 1
    In any case @Totoro this is a non-reproducible problem, meaning anyone else who does the same thing will not have the same result. Either the pi is magically cursed, or you have made a mistake or left out some crucial piece of information. You should try a very simple password (abc123) to make sure there is no mistake, and perhaps run sudo pwconv after you set it to make sure there are no hijinx going on there. – goldilocks Oct 08 '17 at 14:25
  • 1
    The encrypted password is stored in /etc/shadow not in /etc/passwd. – 88weighed Oct 08 '17 at 14:37
  • 1
    How do you reboot the PI? Which command do you use? – NomadMaker May 29 '18 at 04:39
  • I can come up with two causes - you left it with the default password on the open net and someone cracked it, or the keyboard's locale is somehow messing up how it interprets the password. Or in the case of the a corrupted passwd/shadow file - or to actually change the password - you should edit /etc/shadow using passwd (and note the above comments). If you have edited the files directly (can work well as a off-line hack for a forgotten Pi password!), you can check the files using pwck -r /etc/passwd & pwck -r /etc/shadow – Wilf Jul 30 '18 at 22:10
  • I’ve seen a similar issue where the SD card was on the way out BUT the password did not change from the previous value. –  Apr 13 '20 at 02:44

1 Answers1

0

[This is a workaround]

I'm not sure why, but the "pi" SSH password seems to be invalidated upon reboot. Eventually I gave up trying to figure out why and how and worked around this by creating my own user. With this user I can logon after reboot.

Not using the default "pi" user for SSH login may seem to be not too bad from a security perspective anyway.

Hope this helps.

PS: I added my user to the groups "sudo" to install software and "audio" to get the Pi to play sound.