I did the following things to setup auto-logout/timed user-sessions for my son on our home computer running Linux (Ubuntu 11.04):
login|gdm;*;toby;MoTuWeThFr1700-2000|MoTuWeThFr0800-1500
This limits the user “toby” to login only on weekdays between the specified times.
account required pam_time.so
0 15 * * 1-5 /usr/bin/zenity –warning –text=’Logging Toby off in 5 minutes!’ –display=:0.0
5 15 * * 1-5 /usr/bin/killall -s KILL -u toby
0 20 * * 1-5 /usr/bin/zenity –warning –text=’Logging Toby off in 5 minutes!’ –display=:0.0
5 20 * * 1-5 /usr/bin/killall -s KILL -u toby
The zenity command is used to display a warning dialog in the Gnome session for the user “toby” five minutes before the killall command abruptly kills all running programs and the gnome session.
xhost + >& /dev/nullThis will allow the zenity command write to the user’s session (see crontab entries).
Copyright (C) 2013 by Ed
Braaten. All rights reserved.
Other Blog Entries
https://ed.braaten.net/