Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I restrict user from multiple login?

Status
Not open for further replies.

HKNinja

MIS
Nov 17, 2002
148
US
Hi,

As the subject, how can I restrict users from multiple login to the HP-UX server? I want to be able to restrict the number of simultaneous sessions but don't know how to do it. I checked SAM with no result. Please help. Thank you.
 
Regarding which version of HPUX you use, there is a special file named /etc/default/security where you can set this parameter.
I have found it on internet when looking for something else.
It was said to work under HPUX 11i but I have tried it with HPUX 11 and it works fine.


Here is an example :

NUMBER_OF_LOGINS_ALLOWED=3
SU_ROOT_GROUP=su_group
NOLOGIN=1

The first one is self explainable.
The second one prevents user to issue a su command if they do not belong to the name group (even with the root password).
The third one is to prevent logging under / if the user directory is missing.
 
Thanks for your reply, dcu74, but I can't find the security file. Under /etc/default, there're no security. My server is HP-UX 9000.
 
Hi,

You'll need to vi .profile of that user. Do this:

# Limit number of logins allowed
Times_allowed=2
Time_in=` who | grep $LOGNAME | wc -l `
if [ $Time_in -gt "$Times_allowed" ]
then
echo "$LOGNAME is already logged in $Times_allowed times!"
sleep 3
exit
exec /bin/login
fi

Then you'll have to chmod 444 and chown root .profile.

Hope this will help.

cheers,

Mok
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top