[Cubietruck Devuan 1] "Passwd" bug deletes users from /etc/shadow file
Steps to reproduce:
- Install Cubietruck image and sunxi blob as stated in README;
- Log in to devuan;
- Issue a "passwd" command to change root password;
- Add an ordinary user. Define his/her password;
- PAM says an authentication failure;
- Both root and the new user are removed from "shadow" file;
- The system becomes unusable because is not possible to login anymore.
-
It has to do with date settings:
Jul 5 05:18:08 devuan login[1114]: FAILED LOGIN (1) on '/dev/ttyS0' FOR 'root', Authentication failure Jul 5 05:18:14 devuan login[1114]: pam_unix(login:auth): check pass; user unknown Jul 5 05:18:14 devuan login[1114]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=/dev/ttyS0 ruser= rhost= Jul 5 05:18:17 devuan login[1114]: FAILED LOGIN (2) on '/dev/ttyS0' FOR 'UNKNOWN', Authentication failure Jul 5 05:18:25 devuan login[1114]: FAILED LOGIN (3) on '/dev/ttyS0' FOR 'root', Authentication failure Jul 6 09:03:15 devuan sshd[1080]: Server listening on 0.0.0.0 port 22. Jul 6 09:03:15 devuan sshd[1080]: Server listening on :: port 22. Jul 6 09:17:01 devuan CRON[1126]: pam_unix(cron:account): account root has password changed in future
So adjusting the date to the correct time and changing root password one more time solved the issue.
Cubietruck has a hardware battery-backed RTC, but the battery is of low capacity, so clock issues are seen often. One wants to remember to double check the time settings before changing root password, or he/she will be locked outside. Adjust the time, issue a
hwclock --systohc
and only after this change the root password.If you got locked out and have another distro installed on flash, boot into flash then mount the card somewhere, then issue a
chroot <where_the_card_is_mounted>
. Verify the time/date settings then change the root password. Reboot into card again and you're done.Edited by Luzemario -
closed