From owner-freebsd-questions Sat Jan 6 23:12:15 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id XAA20870 for questions-outgoing; Sat, 6 Jan 1996 23:12:15 -0800 (PST) Received: from isgate.is (isgate.is [193.4.58.51]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id XAA20850 Sat, 6 Jan 1996 23:12:09 -0800 (PST) Received: from hummer.islandia.is by isgate.is (8.6.10/ISnet/14-10-91); Sun, 7 Jan 1996 07:11:52 GMT Received: from smarties.islandia.is by hummer.islandia.is (8.6.11/ISnet/12-09-94); Sun, 7 Jan 1996 07:06:57 GMT Date: Sun, 7 Jan 1996 07:06:57 GMT Message-Id: <199601070706.HAA18560@hummer.islandia.is> X-Sender: gestur@islandia.is X-Mailer: Windows Eudora Version 2.0.3 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit To: gestur@islandia.is (Gestur A. Grjetarsson) From: gestur@islandia.is (Gestur A. Grjetarsson) Subject: Re: prevent paralell modem connection Cc: freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org, admin@islandia.is Sender: owner-questions@freebsd.org Precedence: bulk > 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 !