1838282 Members
3069 Online
110125 Solutions
New Discussion

Limit user to one login

 
Craig A. Sharp
Super Advisor

Limit user to one login

I need to find a way to limit my users to a single session (one login). I am not sure how to do this.
Any help would be appreciated. We are running 11.23.

Thanks,

Craig
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Limit user to one login

Shalom,

The best way is by script. /etc/profile is a good place to check this, but be sure to exclude special users like oracle.

logins=$(who am i | wc -l)

if [ logins -ge 2 ]
then
echo "You already have a login session."
exit 1
fi

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Coolmar
Esteemed Contributor

Re: Limit user to one login

Pete Randall
Outstanding Contributor

Re: Limit user to one login

Deepak Kulkarni
Regular Advisor

Re: Limit user to one login

Hi Craig,


`man security` will give the detailed explanantion.

The parameter is NUMBER_OF_LOGINS_ALLOWED paramter should be set to limit.

Cheers
DK
James R. Ferguson
Acclaimed Contributor

Re: Limit user to one login

Hi Steven:

Using:

# logins=$(who am i | wc -l)

...will *always* return a count of ONE!

Regards!

...JRF...