Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: login time restrictions

  • Subject: Re: login time restrictions
  • From: Roy Schestowitz <newsgroups@xxxxxxxxxxxxxxx>
  • Date: Wed, 07 Sep 2005 05:56:14 +0100
  • Newsgroups: alt.os.linux.suse
  • Organization: schestowitz.com / MCC / Manchester University
  • References: <AfkTe.407437$s54.67139@pd7tw2no> <7226301.sbb0vXkmnf@pc-js.chello.pl> <sGkTe.407987$s54.109061@pd7tw2no>
  • Reply-to: newsgroups@xxxxxxxxxxxxxxx
  • User-agent: KNode/0.7.2
__/ [Steve Longstreet] on Tuesday 06 September 2005 18:51 \__

> Jan Stozek wrote:
>> Steve Longstreet zmarszczy? si?, zamy?li? i w wiadomo?ci z wtorek, 6
>> wrze?nia 2005 19:22 napisa?:
>>> I am trying to set up some time restriction rules on Suse 9.3. I
>>> guess my first question would be, is it possible without going to
>>> 3rd party software?
>>> An example of what I want to achieve.:
>>> User1: Login between 4:30PM - 9:00PM
>>         Are these restrictions going to be on a per user, or per system
>> basis?
>>         I had a slightly similar problem: I wanted the system to work not
>> longer, than until midnight. So I wrote a simple boot script executed
>> in 5th runlevel. The script checks the time, and if it's between 5.00
>> and 23.50 - it sets up a shutdown scheduled in an at queue (for
>> 23:58, so that shutdown is finished before cron fires up midnight
>> tasks) and then terminates. If it's a wrong time, shutdown is
>> executed immediately, making it impossible (well... almost :) to use
>> the computer.
> These restrictions would be on a per user basis. I only want to log the
> user out not shut the system down

What about the following cron job:

50 20 * * 1-5 echo "Time to go home" | mailx -s "You will soon be logged
off" jsmith

Then you can kill all jobs of the user 'jsmith'. To ensure that the user
does not log in again, you can repeatedly check if tasks are initiated by
'illegal' users. It is not ideal, but it gives you something sensible, I


Roy S. Schestowitz      | "Did anyone see my lost carrier?"
http://Schestowitz.com  |    SuSE Linux    |     PGP-Key: 74572E8E
  5:50am  up 13 days 13:07,  4 users,  load average: 0.74, 0.66, 0.53

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index