2

I have a Raspberry Pi running Jessie that I'm using as a notification gateway.

If I SSH to it and change the user pi password, it appears to take and when I open a separate SSH session to it it requires the new password. I also create several new users, set their passwords and allow them to sudo with no password.

However, if I reboot I loose all that config changes, the new users and the user pi reverts to the default password, raspberry.

Commands used:

passwd
enter old password:raspberry
enter new password:<new password>
re-enter new password:<new password>

Then initiate a new SSH using the pi user, prompts for password > enter NEW password, access granted

reboot

Initiate SSH using user pi, password prompted > raspberry, access granted

MatsK
  • 2,478
  • 3
  • 12
  • 20
  • Have you tried to reformat the SD card with a new copy of the OS? – MatsK Jan 14 '18 at 11:52
  • I haven't. it took me weeks to get a Whatsapp gateway to work with Xtool, several scripts and nodered objects. It was my first attempt at Rasbian and I didn't document it very well as I figured it all out. Re-Format would basically be the nuclear option. I was hoping it was me doing something dumb. – David Skilton Jan 14 '18 at 12:58
  • Ok, but now I suspect that you have been hacked. If you have had your system online without changed the passwords at first boot thats like inviting people in... And to use "sudo with no password" is a bad security practice. – MatsK Jan 14 '18 at 13:56
  • 2
    Make sure your microSD card hasn't gone bad. Try writing a file, rebooting and verifying it's actually there. On failures, it can look like everything is working for some time, but the card won't actually store any new data. I do hope you have a backup. – bobstro Jan 18 '18 at 16:46

3 Answers3

1

This is exactly how a RW filesystem on a read-only medium looks like. There's no immediate error when you save the file, but the file is not saved after all. Try the raw IO script and see if the data persists: if not, the SD card is end-of-life.

Since it's Jessie we're talking about (presumably connected to the Internet), I'd say it's time to make a back-up and flash an OS which is not outdated. If you can't flash a new OS on that SD card, you'll need to get a new card as well.

Dmitry Grigoryev
  • 26,688
  • 4
  • 44
  • 133
0

I would use exactly the same commands as you did in order to change the password. If that doesn't work I would think that there is a bug in the OS. Like MatsK suggest, I would recommend you the reinstall your OS. I'm not telling you your device has been hacked, but it's not normal anyway.

Belekz
  • 158
  • 9
0

Hint: check your dmesg if it shows any i/o errors preventing your change from being written to SD. Sometimes SDs can be faulty, even fresh off the shelf.

mldevw
  • 21
  • 1