LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   non-sticky password problem: Debian system with no clock (https://www.linuxquestions.org/questions/linux-newbie-8/non-sticky-password-problem-debian-system-with-no-clock-4175578613/)

BruceV 04-29-2016 03:59 AM

non-sticky password problem: Debian system with no clock
 
Hi I run Debian on small embedded ARM boards that have no battery storage, so every time the system boots, the time reverts to Linux time zero. There's one user account, "Useracnt", every time I try to log into it I am instructed to change the password. I've tried the following command from root, which should have set the password to never change:

chage -I -1 -m 0 -M 99999 -E -1 Useracnt

But this hasn't helped. I'm just guessing that the absence of a clock is associated with the problem, but it could be something else. Any suggestions on how I can fix this?

I can run from root, but it's not a preferred option for obvous reasons.

Thanks in advance.

MensaWater 04-29-2016 10:13 AM

Maybe it is confused because the time it sees is before the time the password was created. What if you let it revert to time 0, change the password and THEN run your chage command line?

Habitual 04-29-2016 10:31 AM

Read-Only File System?

michaelk 04-29-2016 10:44 AM

Could be read only or the operating system runs from RAM. Not enough information...

BruceV 05-01-2016 06:41 AM

All noted. Thanks, still trying things.

jpollard 05-02-2016 09:28 PM

IF there is somewhere writable, it is possible to save the current system time at shutdown...
Then during boot reload it.

The time still won't be correct - but it will be constantly moving forward.

This used to be done when/as the root filesystem got mounted, using the dismount timestamp for the current time.

I believe using "date +%m%d%H%Y.%S >shutdown.time" just before dismounting root (assuming it is writable), then using "date `cat shutdown.time`" should set the clock.

Of course, if you have a network connection using ntpd would work better. Assuming this was a RaspberryPI or something similar there is (or should be) a RTC available.

If you have a log file you could set the date based on that using the -r option (something like date -s `date -r /var/log/logfilename`, or maybe date -s --date="`date -r /var/log/logfilename`"), but you would have to experiment to decide if you need to get it in an acceptable format...

(BTW, the date -r uses the modification time of the file, and none of my examples have been tested for correctness.)

http://www.thegeekstuff.com/2013/05/...mand-examples/


All times are GMT -5. The time now is 03:58 PM.