1

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 !!!

  • 1
    How about you add him as a separate user? This way you could easily control his access, e.g. with timekpr (disable guest access!). – dessert Dec 16 '17 at 15:19
  • https://askubuntu.com/a/399122/158442 - for setting the password – muru Dec 16 '17 at 15:19
  • It might be more secure to setup 2FA: https://askubuntu.com/q/726969/158442. Your brother might get lucky and guess the password once he figures out the pattern, but guessing the 2FA code would be a shade harder. – muru Dec 16 '17 at 15:21
  • Oh : the 2FA seems interesting, but in my case, I don't want to use an additional device. I am confident enough to find a pattern which would be strong enough for a 12 years old guy. I'm a student in a polytechnique university, so I find a way. Let's say the first four digits in cosh(day of week times day in month divided by the year). I always have a calculator nearby. – Johannes Lemonde Dec 16 '17 at 15:32
  • 1
    See How do I restrict my kids' computing time? for a way to do time-based access using PAM without needing a 3rd party PPA – steeldriver Dec 16 '17 at 15:42

0 Answers0