LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-29-2016, 04:59 AM   #1
BruceV
LQ Newbie
 
Registered: Jan 2016
Posts: 8

Rep: Reputation: Disabled
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.
 
Old 04-29-2016, 11:13 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
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?
 
Old 04-29-2016, 11:31 AM   #3
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,159
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Read-Only File System?
 
Old 04-29-2016, 11:44 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,930

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Could be read only or the operating system runs from RAM. Not enough information...
 
Old 05-01-2016, 07:41 AM   #5
BruceV
LQ Newbie
 
Registered: Jan 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
All noted. Thanks, still trying things.
 
Old 05-02-2016, 10:28 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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/

Last edited by jpollard; 05-02-2016 at 10:37 PM.
 
  


Reply

Tags
change user, clock, debian, passwords


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian system clock unexpected change to wrong time wuwenli Linux - Software 1 03-22-2012 02:48 AM
Password problem with clock applet Debian 4.0 jgz Debian 4 01-24-2008 12:32 AM
System Clock Problem combilli Linux - Software 2 07-05-2007 01:57 PM
Debian in PA-RISC - System Clock is reset to Jan 1970 at bootup wgpaine Linux - General 2 02-07-2004 11:38 AM
help!! system clock problem hyd_lin Linux - General 6 05-30-2003 12:59 PM


All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration