Subject: [891] Re: [888] Re: [887] Adding time limit

From: Michael Regoli <[email-masked]>
Date: Fri, 09 Dec 1994 15:20:06 -0500

From [email-masked] Fri Dec  9 14:44:26 1994

	Irwin Nemetz said ::
	> 
	> I am search for a ftp daemon which can limit a connection to
	> a certain length of time per day. 
	
	Create several different ftpaccess files, with appropiate
	limits you want in each.  Then write a simple shell script to
	copy the one you want over, and cron it for the specified
	time.
	
	Dunno what happens to connections on at time of switch.  Like,
	if you have 48 people on at 7:59a and lower it to 20 at 8:00a,
	I assume the 48 will be on until they disconnect...

	Andrew
	-- 
	
	(c) 1994, Andrew Bennett

I wrote a couple little shell scripts to handle this, rather than have
different versions of "ftpaccess" sitting around. 

At 6pm every night, we open up to 75 connections.  So, through cron,
at 6pm, I run the following script:

  #!/bin/sh
  ftpaccess="/usr/spool/ftp/ftpd/ftpaccess"
  sed -e 's/world    ../world    75/'< $ftpaccess  > /tmp/.click$$
  mv /tmp/.click$$ $ftpaccess
  echo  "Accepting 75 anonymous users at `date`" >> /var/adm/cronlog

This changes the "world" class (in which all of our anonymous traffic
goes through) to 75 users.  Then, at 715am every morning, we back it
down to 35, through another script that changes it back.  I call
these scripts "allow45", "allow75", etc., and the calling line in the
crontab looks like:

15 7 * * 1-5 /usr/spool/ftp/ftpd/allow45  /* 45 users at 7:15a daily */
0 18 * * 1-5 /usr/spool/ftp/ftpd/allow75  /* 75 users at 6pm daily */

Note these are SunOS crontabs.  Your format may/will differ.

There's no doubt several different (and more elegant) ways to
accomplish this...this does work for me, though.

michael regoli
[email-masked]

---

From: [email-masked] (Irwin Nemetz)
Date: Sat, 10 Dec 1994 00:25:28 -0500

>Irwin Nemetz said ::
>> 
>> I am search for a ftp daemon which can limit a connection to a certain
>> length of time per day. Does anyone want to take on the challange of
>> modifying wu-ftpd to add this capability ? I was hoping to be able to do it
>> myself but looking at the source code, I don't think I can do it.
>
>Create several different ftpaccess files, with appropiate limits you want
>in each.  Then write a simple shell script to copy the one you want over,
>and cron it for the specified time.
>

Perhaps I was not clear enough. It's been a long week. So let's try again.

What I want is to limit a particular user's connection to say 30 minutes per
day. It would be the same as an idle limit except it would count from the
time they logged in. The Novell ftp server has this feature. As the server
is keeping track of time anyway, because it knows to log you out after a
certain idle time, I don't think it would be that hard to add this feature
(famous last words).

The easy part (???) is to log them out after x number of minutes. What is
probably trickier is to stop them from logging right back in again.

Isn't somebody looking for a project for the Christmas break ?

Irwin