Restricting Multiple loggin sessions


 
Thread Tools Search this Thread
Operating Systems Solaris Restricting Multiple loggin sessions
# 1  
Old 06-05-2005
Restricting Multiple loggin sessions

Any idea as to how multiple loggin sessions by the same user (using Hyper terminal/Telnet) be restricted in Sun Solaris 8.

Rgds

Naushi
# 2  
Old 06-06-2005
you can add the following to the users profile :

USERLOGINS=`who | grep ( userid ) | wc -l`
if [ "$USERLOGINS" -eq ( max no. of logins ) ] ; then
exit 1
else
( process remaining environment )
fi


cheers
# 3  
Old 06-06-2005
If we are strict at "restrict", there should be better approach. Is there PAM for Solaris?
# 4  
Old 06-06-2005
What's PAM
# 5  
Old 06-06-2005
Quote:
Originally Posted by Naushi
What's PAM
Pluggable Authentication Modules and no it's not there in Solaris 8 by default.
# 6  
Old 06-06-2005
Thanks ppass, I'll try it out.
# 7  
Old 06-07-2005
Quote:
Originally Posted by ppass
you can add the following to the users profile :

USERLOGINS=`who | grep ( userid ) | wc -l`
if [ "$USERLOGINS" -eq ( max no. of logins ) ] ; then
exit 1
else
( process remaining environment )
fi


cheers
Add this to the global profile (/etc/profile or whatever) otherwise the user will just login, vi $HOME/.profile, and remove it....

Code:
MAXLOGINS=5   # or whatever
WHOAMI=`whoami`
CURRENTLOGINS=`who | grep -c "${WHOAMI}"`
if [ "${CURRENTLOGINS}" -eq "${MAXLOGINS}" ]; then
  exit 1
fi
# no need for else.... rest of profile goes here

Cheers
ZB
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sessions across multiple scripts.

I wish to be able to pass PHP values between multiple scripts. In each script, I have the following before any HTML code: <?php session_start(); session_name("STORE"); session_set_cookie_params( 'lifetime', '/var/www' ); session_id('Gingy'); ... (1 Reply)
Discussion started by: Meow613
1 Replies

2. Red Hat

multiple ssh sessions

Hi, I use OpenSSH to log on to a RH server but when I enter the password 2 session windows appear. I only need one so can anyone advise where I can rectify this? R, D. (2 Replies)
Discussion started by: Duffs22
2 Replies

3. Red Hat

Restricting multiple users to run only sftp server

Hello, can someone please provide steps, can I restrict a multiple users to only access only sftp on a server, to perform upload and download of files on their home directories. 1. I have updated their login shell as /sbin/nologin. anything else do I need to update. Thanks, (3 Replies)
Discussion started by: bobby320
3 Replies

4. AIX

Multiple sessions with xming

Hi. I installed xming to access to my servers but I have a problem : i can only have one session at a time ... i don't find any parameter to change this. Tks (3 Replies)
Discussion started by: stephnane
3 Replies

5. Solaris

NIS - Client Not loggin in

Friends n Gurus I am creating an NIS farm(Solaris only) in my office. I have successfully configured the NIS master and slave servers and a few NIS clients. However i am not able to log into a few of my NIS clients. The commands "ypcat passwd" is displaying the NIS user. However when i try to... (5 Replies)
Discussion started by: Renjesh
5 Replies

6. UNIX for Advanced & Expert Users

Multiple Sessions with FTAM

Just a quick question, Can I establish Multiple Sessions between two machines using FTAM? Regards, Gaurav Goel (0 Replies)
Discussion started by: gauravgoel
0 Replies

7. AIX

Locking a file when using VI to prevent multiple-edit sessions by diff users

At the office, we often have to edit one file with VI. We are 4-6 workers doing it and sometimes can be done at the same time. We have found a problem and want to prevent it with a file lock. Is it possible and how ? problem : Worker-a starts edit VI session on File-A at 1PM Worker-b... (14 Replies)
Discussion started by: Browser_ice
14 Replies

8. Shell Programming and Scripting

Creating multiple sessions

I have a program which gets an input file (which contain a list of objects) and processes the objects one by one sequentially. However when there are many objects it is faster to split the input into smaller lists and run the program in multiple terminal sessions simultaneously. I want to know if... (2 Replies)
Discussion started by: stevefox
2 Replies

9. Shell Programming and Scripting

Multiple PHP sessions within the same browser instance

Dear all..... I am currently writing a Help-Desk / Knowledge Base application using PHP/PostGreSQL. I authenticate the user using a quite elaborate mechanism of cookies. The problem is that using cookies (I also have a version using sessions with the same problem), I can only seem to get one... (4 Replies)
Discussion started by: zazzybob
4 Replies

10. UNIX for Dummies Questions & Answers

Loggin mail transfer

Hi Folks, I'm trying to log incoming and outgoing messages on my Solaris box. I thought I could use 'mail.info /var/log/maillog' in my syslog.conf but it doesn't give any output. mail.debug does but only seems to log client connections to the server and the odd message ID. Is there a way... (4 Replies)
Discussion started by: Ben
4 Replies
Login or Register to Ask a Question