To everyone,
I am looking for a way to restrict the kids to 1 hr of PC time. Is there any PAM configs I can use? I am not good with scripts, does any one have a script that could limit the time of a users logon at one seating?
Thanks,
John
To everyone,
I am looking for a way to restrict the kids to 1 hr of PC time. Is there any PAM configs I can use? I am not good with scripts, does any one have a script that could limit the time of a users logon at one seating?
Thanks,
John
Hi,
There is a PAM module named ‘pam_time’ which is intended to impose some access restrictions to the system based in the following factors:
services, terminals, users and times (specific days or time ranges of the day)
Its configuration file is /etc/security/time.conf and is usually configured as a required session module:
**session required pam_time.so **
You could be interested in it. I have never used it before, so I can’t tell you if it is operative/usable in Open Suse 11,
Better take a look at this url for more details about the module
6.32.*pam_time - time controled access
and this other one, where an example of access restriction via pam_time in SLES/SLED is discussed:
PAM (Pluggable Authentication Module) Tricks | Novell User Communities
I don’t have a script that fits your needs, but I can give you some ideas.
You can build one that make use of ‘who’ to find out the users with on-going sessions and the time the logged-in.
Once you know the users, you can get the list of processes spawned for a given user via ‘ps -u’
Having the list of processes for a given user, you can terminate them by means of kill -SIGTERM or kill -SIGKILL
To make this process automatic, create an crontab entry for the user root to be run every minute.
This is the skeleton. You can configure the ‘time window’ during wich the restricted users are allowed to be logged storing those values in variables that will be set in the script.
Regards.