Link to home
Start Free TrialLog in
Avatar of Panda 5888
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
Avatar of medvedd
medvedd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Panda 5888
Panda 5888

ASKER

medvedd, ths link is for Solaris 10 only, how about solaris 8?
I can't find any existing solutions for Solaris 8. You can try to port Linux module pam_limits to Solaris.
SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
omarfarid, tested and not working.
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?
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
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?
omarfarid, in csh shell.
Ok, I will send sometime later what you need to include in the user's .login file
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
omarfarid, still can login mutilsession, anyway, thank for your help.
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
sorry, but in my code it should have been

if ( $c >= 2 ) then
Thank you, omarfarid.