Date format of chage -E command
By John Parsons •
I would like to know what is the right format to put in the command:
sudo chage -E (DATE) (USERNAME)Also, if it is possible to put hours, minutes and seconds.
1 Answer
From man chage:
-E, --expiredate EXPIRE_DATE Set the date or number of days since January 1, 1970 on which the user's account will no longer be accessible. The date may also be expressed in the format YYYY-MM-DD (or the format more commonly used in your area). A user whose account is locked must contact the system administrator before being able to use the system again.Either you want a number of days, or a YYYY-MM-DD string. Time of day is not taken into account.
Try also date +%F -d "+30 days" which outputs the date in 30 days time from "today".
chage -E $(date +%F -d "+30 days") USER More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"