Hello, I have just given a computer to my children which is in their bedroom. One of my concerns is that I don’t want them up all night playing games and surfing the web. How can I set up restrictions associated to their login to only allow them to use the computer at certain times? Say, they’re only allowed to login at 8:00 AM - 9:00 PM. If they’re logged in at 9 PM, I’d also like the ability for the system to lock/log out. Is it possible to set this kind of configuration? I’m using OpenSuse 11 and KDE.
And if you want to really impress them with your supernatural powers, you could make a recording of your voice, admonishing them about disobeying you and add extra commands to the cron setup so it plays the recording to them, then pauses 10 seconds and then shuts the computer down. If the voice file is myvoice.mp3, you use this version of hcvv’s crontab entry:
Hehe, imagination only limits this sort of approach.
When you decide to make a shell script of this, I advise to put the script into /root/bin/ (that is the bin directory in root’s home directory). Do not forget to make it executable for the owner (chmod u+x /root/bin/yourscript) and then call the script from the crontab:
*/5 21-23,0-7 * * * /root/bin/yourscript
You can then easily change the script without using crontab -e every time. And your script may be as impressive as you like it (you could even check if your own user is active and decide not to shutdown in that case).