Solved

How can we stop multiple logins?

Posted on 2006-06-19
7
530 Views
Last Modified: 2008-01-09
Is there a way to stop multiple remote logins to a AIX Unix server?

If this is possible can we allow multiple logins from a single terminal?
0
Comment
Question by:htgits
7 Comments
 
LVL 11

Accepted Solution

by:
tel2 earned 250 total points
ID: 16938582
Hi htgits,

I don't know of a "build-in" method, but you could have a script which creates a lock file when a user logs on to an account.  When the next user attempts to logon to the same account, it checks that lock file to see if the first user is still on.  If so, then logoff, otherwise, replace the lock file.

Yes, you could allow multiple logons from a single terminal by including something unique about that terminal (eg: IP address) in the lock file, and checking for that.

Does that sound like what you require?
0
 
LVL 3

Author Comment

by:htgits
ID: 16938666
Yes that sounds what we are looking for.

How do we know when a user logs off? I.E. Where would the script go to be executed when the users session ends?

I'm guessing we can also excule the "root" user from this process?

Thanks for you help
0
 
LVL 6

Assisted Solution

by:JJSmith
JJSmith earned 250 total points
ID: 16938797

In a lot of UNIX flavours a user enters through a profile - within this profile you can set a 'trap' to catch the exit signal, amongst others. When catching signals you can do anything you please including removing a flag file.


e.g.
#profile

#set the trap for signals 0 thru 3 - see man signal
trap  "rm -f /tmp/user_login_flag"  0  1  2  3

On your terminal question - do you mean a user can only login once, unless they login again from the same terminal?

To eliminate root from any processing just add ' uid not equal 0 ' to any condition logic you write.

Cheers
JJ
0
 
LVL 11

Expert Comment

by:tel2
ID: 16938884
Hi htgits,

> How do we know when a user logs off? I.E. Where would the script go to be executed when the users session ends?

I assume JJ's option would generally work (I've never tried it), but it may not cater for things like power failures.  You wouldn't need to check when they log off.  What I'm saying is:
> When the next user attempts to logon to the same account, it checks that lock file to see if the first user is still on.
The lock file might be named with the IP address (eg: lock_1.2.3.4) and contain something like the PID for that session.  When the next session is logged on for that account, that PID is checked to see if it still exists (and still belongs to that account).  If it does, then disallow the login.
0
 

Expert Comment

by:nilehawk
ID: 17435117
don't apply any lock method to life system you need to test it first on test plant
good luck
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now