Logging off and locking out users at specific times
I need a way to log off a user at a specific time, and disable her account until a specific time. I could probally figure out how to make a script that would disable her account by editing the passwd file twice a day, but im not sure how to go about logging her out if she is already signed in. I thought about doing it by having the same script change the run level, but Id much rather not do that just to kick a user off a system.
Also, it would be perferable to have a five minute warning that she is going to be kicked off, so if she is actually doing anything important she can save her files. This is to make a girl who spends way too much time on the slackware box im loaning her actually do her homework and go to bed, even if her parents arent home. Any suggestions on where to start, or any programs that may make this easy? |
logoutd may be of use to you
man logoutd man porttime |
these services seem to work very niceley.
Thanks :) |
ok... almoast there.
the only problem is that a reboot kills logoutd. Putting it in the rc file doesnt make it come up at boot time. any ideas? from the man page: logoutd enforces the login time and port restrictions specified in /etc/porttime. logoutd should be started from /etc/rc. The /etc/utmp file is scanned periodically and each user name is checked to see if the named user is permitted on the named port at the current time. Any login session which is violating the restrictions in /etc/porttime is terminated. i tried creating a file in etc called rc and putting logoutd in it. doent come up at boot. I tried doing whereis logoutd and putting the full path in the rc.local file (which starts my no-ip.com proggy)... that doesnt work either. Typing logoutd as root works fine.... but a reboot will let the user back in by killing the service. Ideas? |
Add
/usr/sbin/logoutd to the bottom of the /etc/rc.d/rc.M file or you could go the whole hog and use the syntax the rc.M file uses if [ -x /usr/sbin/logoutd ]; then /usr/sbin/logoutd fi |
When I saw your name as the last poster i knew it would be fixed :)
Thanks, its working great now :) |
All times are GMT -5. The time now is 06:31 PM. |