From owner-freebsd-hackers Wed Jan 3 09:28:46 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA21840 for hackers-outgoing; Wed, 3 Jan 1996 09:28:46 -0800 (PST) Received: from brasil.moneng.mei.com (brasil.moneng.mei.com [151.186.109.160]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id JAA21792 Wed, 3 Jan 1996 09:28:27 -0800 (PST) Received: (from jgreco@localhost) by brasil.moneng.mei.com (8.7.Beta.1/8.7.Beta.1) id LAA13230; Wed, 3 Jan 1996 11:27:06 -0600 From: Joe Greco Message-Id: <199601031727.LAA13230@brasil.moneng.mei.com> Subject: Re: prevent paralell modem connection To: gestur@islandia.is (Gestur A. Grjetarsson) Date: Wed, 3 Jan 1996 11:27:05 -0600 (CST) Cc: freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org, admin@islandia.is In-Reply-To: <199601031528.PAA12069@hummer.islandia.is> from "Gestur A. Grjetarsson" at Jan 3, 96 03:28:03 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@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