I would like to configure my computer to have a session whose password would change automatically every day. The password needn't be very strong, and must be easy to reconstruct mentally (I will think about a mathematical formula to return a number as function of the date, which would be hard enough to crack). The sake of the thing is that I would be the only one to be able to reconstruct current day's password and my little brother, which is 12 years old, would have to ask for the password if he needs the computer that day, since I sometimes come back late in the evening, and I can't monitor him when I'm not at home.
I thought to add a few lines of code in a script which would be run once when the computer is turned on, even before a session is opened. Does root's crontab with the @reboot flag make the job ?
It may be a line such as passwd "example"$(date "+%w%d")
(the password generated would be more complex, but that's an example), but let say that I want root to perform that action, and I don't find in the manual a way to change the password for a specific user. I would like to write something similar to echo "example"$(date "+%w%d") | passwd --user mylittlebrother
, but the option --user does not exist...
How should I proceed ? Is there a better way to do that ?
Thanks in advance !!!
0 Answers