Date: Sun, 7 Jan 1996 07:06:57 GMT From: gestur@islandia.is (Gestur A. Grjetarsson) To: gestur@islandia.is (Gestur A. Grjetarsson) Cc: freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org, admin@islandia.is Subject: Re: prevent paralell modem connection Message-ID: <199601070706.HAA18560@hummer.islandia.is>
next in thread | raw e-mail | index | archive | help
> Hello,
>
> I'd like to ask you,
>
> Could users on FreeBSD system hold two or more modem connections at
> same time, parallel logged on ?
Sure.
> If so, is there a way to prevent people to be able to get connection on
> the system from two or more places at one time, like if users share their
> accounts, taking two modems and only paying for one account ?
Sure. Stick a "cron" job in to count the number of times that a user is on
a tty line. Think about something like:
#! /bin/sh -
PATH=/bin:/usr/bin; export PATH
who | grep " ttyd" | sort | uniq -c | (
while read count user; do
if [ ${count} -gt 1 ]; then
kill -HUP `ps agxu | grep "^${user} " | awk '{print $2}'`
fi
done
)
This is of course very simplistic but could be effective if run out of cron,
say, every 5 minutes (excuse any errors, I have NOT tested it, you shouldn't
run it unless you understand what it is doing and can fix my bugs)...
This is simpler than the network/X11 pty case, of course.. ;-)
> My system has limited amount of modems attached, so it would be of good
> appreaciation if I could manage to prevent parallel modem connections for
> one user.
... Joe
-------------------------------------------------------------------------------
Joe Greco - Systems Administrator jgreco@ns.sol.net
Solaria Public Access UNIX - Milwaukee, WI 414/342-4847
Međ kveđju,
Sincerely,
-----------------------------------------------------------
Gestur A. Grjetarsson
kerfisstjóri islandia.is sysadmin islandia.is
Islandia, Grensásvegur 7, 2h.t.h., 108 Reykjavik
sími 5884020, modem 5884120, fax 5884014
http://www.islandia.is
http://www.islandia.is/english.htm
-----------------------------------------------------------
Programmers never die, they just GOSUB without RETURN !
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601070706.HAA18560>
