[SunHELP] Allowing 1 telnet login session per userid.

Bob Kryger bobk at panix.com
Wed Jun 12 20:56:34 CDT 2002


>I can write a check and put it into /etc/profile but its not a very neat
>solution.


Why is this not a very near solution. It would be very simple in the 
/etc/profile to check the wtmp file via the last command.  Something 
similar to ...

         LOGINS=$(last | grep $USER | wc -l)
           if [[ $LOGINS >= $MAX_LOGINS ]]
           then
                 kill -9 <mypid>
           fi

You might want to output a message, and possibly log and also limit this to 
specific users (i.e. not root and you)

Sounds pretty clean to me.

Bob

Robert F. Kryger, Jr.
10 Tuttle Street, Apt 2G
Stamford, CT 06902

Home: +1-203-358-9976     Cell: +1-203-981-4018
Personal E-mail: bobk at panix.com, bobk at frodo.com, bkryger at optonline.net
AOL Instant Messanger: BobKryger, KrygerFamily
PGP Key: 
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=bkryger%40home.com



More information about the SunHELP mailing list