• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

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?
0
Panda 5888
Asked:
Panda 5888
  • 9
  • 6
  • 2
2 Solutions
 
medveddCommented:
Ideal solution will be special PAM module, but I can't find it.
Here is some workaround:

http://blogs.oracle.com/darren/entry/limiting_users_to_one_login
0
 
Panda 5888EngineerAuthor Commented:
medvedd, ths link is for Solaris 10 only, how about solaris 8?
0
 
medveddCommented:
I can't find any existing solutions for Solaris 8. You can try to port Linux module pam_limits to Solaris.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
omarfaridCommented:
you may put commands into .profile file of the user to check if the same user already logged in then exit / logout

e.g.

c=`who | grep -$USER | wc -l`
if [ $c -gt 1 ]
then
logout
fi
0
 
Panda 5888EngineerAuthor Commented:
omarfarid, tested and not working.
0
 
Panda 5888EngineerAuthor Commented:
Problem not solve due to limitation of Solaris 8, thank for someone that try to help me as above.
0
 
omarfaridCommented:
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?
0
 
Panda 5888EngineerAuthor Commented:
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
0
 
omarfaridCommented:
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?
0
 
Panda 5888EngineerAuthor Commented:
omarfarid, in csh shell.
0
 
omarfaridCommented:
Ok, I will send sometime later what you need to include in the user's .login file
0
 
Panda 5888EngineerAuthor Commented:
omarfarid, .login or .cshrc also can, thank you very much.
0
 
omarfaridCommented:
try this in .login

set c=`who | grep $USER | wc -l`
if ( $c == 1 ) then
logout
endif
0
 
Panda 5888EngineerAuthor Commented:
omarfarid, still can login mutilsession, anyway, thank for your help.
0
 
Panda 5888EngineerAuthor Commented:
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
0
 
omarfaridCommented:
sorry, but in my code it should have been

if ( $c >= 2 ) then
0
 
Panda 5888EngineerAuthor Commented:
Thank you, omarfarid.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 9
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now