Is it possible to make linux require user password only during specified time range, eg. from Monday to Friday? I want to set it this way on my Linux Mint, so that kids cannot access computer on school days without permission, but still allowing to login with password on school days...

EDIT: By login I mean logging in to system using gui

  • Please be more specific by what you mean with "require password". Do you want to be able to login graphically without a password? Login on a (remote) shell? Run sudo without a password?
    – slhck
    Dec 16 '14 at 12:34
  • @slhck Edited the question.
    – burtek
    Dec 16 '14 at 15:21
  • write a script to run on boot, if the day is a weekday, edit the gui config file to allow passwordless auto login. remove that line in a script that runs when gui finishes logging in. it's not as hard as it sounds
    – Sirex
    Dec 16 '14 at 16:22

This is possible... You make a bash or a programe that change password or disable account for kids on specific day, and than return correct password or account in weekends.

The programe that is responsible for change password or disabeling accounts should be in ~/.xinitrc or some other file that runs before login...

if [[ $(date +%u) -gt 5 ]] ; then
    //Your programme

For additional information check...
- Disabling User Accounts
- Running bash at start up

Im running minimal debian with wmii so i put my start up bash in ~/.xinitrc you can chose some other file that run at different run level.

Hope it helps... :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.