Panda 5888
asked on
Allow only one login session
I have one Solaris 8 running in mutilusers mode, but due to security issue, I need to create one special account that allow only one seesion login at a time, it means no second session at the same time, is it possble to do that in Solaris 8?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I can't find any existing solutions for Solaris 8. You can try to port Linux module pam_limits to Solaris.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
omarfarid, tested and not working.
ASKER
Problem not solve due to limitation of Solaris 8, thank for someone that try to help me as above.
Sorry, I was a way from my computer. If you still need help with my script I am ready to help.
Can tell me what did not work?
Can tell me what did not work?
ASKER
omarfarid, I'vr tried put commands in .profile but I still can login multisession in same account.
e.g
c=`who | grep -$USER | wc -l`
if [ $c -gt 1 ]
then
logout
fi
e.g
c=`who | grep -$USER | wc -l`
if [ $c -gt 1 ]
then
logout
fi
I think there is a mistake in the grep line. Please remove the -
c=`who | grep $USER | wc -l`
if [ $c -gt 1 ]
then
logout
fi
Is the code put in the user .profile? is the user using sh/ksh/bash as login shell?
c=`who | grep $USER | wc -l`
if [ $c -gt 1 ]
then
logout
fi
Is the code put in the user .profile? is the user using sh/ksh/bash as login shell?
ASKER
omarfarid, in csh shell.
Ok, I will send sometime later what you need to include in the user's .login file
ASKER
omarfarid, .login or .cshrc also can, thank you very much.
try this in .login
set c=`who | grep $USER | wc -l`
if ( $c == 1 ) then
logout
endif
set c=`who | grep $USER | wc -l`
if ( $c == 1 ) then
logout
endif
ASKER
omarfarid, still can login mutilsession, anyway, thank for your help.
ASKER
omarfarid, look working now, thank you very very very much.
csh shell
=========
% more .login
set c=`who | grep $USER | wc -l`
if ( $c == 2 ) then
logout
endif
csh shell
=========
% more .login
set c=`who | grep $USER | wc -l`
if ( $c == 2 ) then
logout
endif
sorry, but in my code it should have been
if ( $c >= 2 ) then
if ( $c >= 2 ) then
ASKER
Thank you, omarfarid.
ASKER