Forum: Cfengine Help
Subject: Re: Looking for some guidance with syncronizing passwords in AIX
Author: matter
Link to topic: https://cfengine.com/forum/read.php?3,20589,20608#msg-20608

I should give you an example. Let say you want to change the mysql userid 
"lastupdate" field to reset the last time the password was changed (or to trick 
it to think it has been changed)


chsec -f /etc/security/passwd -s mysql -a lastupdate=1297433449


1297433449 is epoch time for Feb 11 2011 09:10:49

Which leads me to a neat little epoch script I wrote in case someone is 
interested in converting epoch times:


#!/bin/ksh
 
if (( $1 )); then
  date_epoch=$(echo "0t$1=Y" | /usr/bin/adb /etc/motd | awk '{print $2" "$3" 
"$1" "$4}')
  echo "$date_epoch\n" 
else
  epoch_seconds=$(awk 'BEGIN {srand(); printf("%d\n", srand())}')
  echo "$epoch_seconds\n";
fi


If you give it a parameter is will convert it to real time, no parameter it 
will give the current time in epoch.

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to