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.
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.
# 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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.