Operating System - HP-UX
1834185 Members
2868 Online
110064 Solutions
New Discussion

Re: Limit user connection

 
SOLVED
Go to solution
Vogra
Regular Advisor

Limit user connection

Hi All.
how can I limit the number of connection by user at same time - HPUX10.20 ?
Thanx.
We are spirits in the material world
1 REPLY 1
Patrick Wallek
Honored Contributor
Solution

Re: Limit user connection

The only thing I can think of is to put something into one of the . files (.cshrc, .login, .profile, etc.) for each user and check to see if they are already logged in, if so, how many times. If they are logged in too many times, then tell them they aren't allowed any more logins and do an exit.

Something like this:

#!/bin/sh

user=`echo $LOGNAME`
num_logins=`who | grep $user | wc -l`

if ( $num_logins > 2 ) then
echo "You have already have 2 sessions. You can't login anymore"
sleep 15
exit
fi