5

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

3
  • 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
    Commented Dec 16, 2014 at 12:34
  • @slhck Edited the question.
    – burtek
    Commented Dec 16, 2014 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
    Commented Dec 16, 2014 at 16:22

1 Answer 1

2

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
fi

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... :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .