From owner-freebsd-questions Thu Jan 4 06:10:30 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id GAA06272 for questions-outgoing; Thu, 4 Jan 1996 06:10:30 -0800 (PST) Received: from bsd.tseinc.com (bsd.tseinc.com [199.217.191.65]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id GAA06267 for ; Thu, 4 Jan 1996 06:10:26 -0800 (PST) Received: from ws2.tseinc.com (ws2.tseinc.com [199.217.241.142]) by bsd.tseinc.com (8.6.11/8.6.9) with SMTP id IAA03223; Thu, 4 Jan 1996 08:09:27 GMT Date: Thu, 4 Jan 1996 08:09:27 GMT Message-Id: <199601040809.IAA03223@bsd.tseinc.com> X-Sender: jlwest@bsd.tseinc.com X-Mailer: Windows Eudora Light Version 1.5.2 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: freebsd-questions@freebsd.org From: "Jay L. West" Subject: parallel logon question (gestur@islandia.is) Sender: owner-questions@freebsd.org Precedence: bulk gestur@islandia.is asked about preventing parallel logons. Here's the solution that we use here. All our customers dial in via iij-PPP. When we create their account the logon shell is set to /usr/local/bin/ppplogin. The idea is that the ppplogin script will kick off iijppp. Our ppplogin is: #!/bin/sh - if [`who | cut -d\ -f1 | wc -l` -gt 1]; then echo Already logged on. exit fi /usr/sbin/ppp -direct `tty|cut -d/ -f3` Things to note -- there are TWO spaces after the -d\ in the second line. There's probably a better way to indicate a space delimiter, but I'm no script programmer. After the wc is a -letter not -number and after the -gt is a number not a letter. The last line starts ppp with a label of the current tty port. This is because we pseudo-dynamically assign ipa's (per tty rather than per connect). As a result your final line that starts ppp may vary. Use what you've got working already there. This works great for ppp. For shell accounts, you could use the same logic above but put it in the skeleton .profile or $HOME/.profile (or /etc/profile if FreeBSD uses that). The other solution I saw posted here suggested a crontab entry, but your users might find it more palatable to not get a second login rather than getting it and then being kicked off. Hope this helps! Jay L. West