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

How can we stop multiple logins?

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
htgits
Asked:
htgits
2 Solutions
 
tel2Commented:
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
 
htgitsAuthor Commented:
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
 
JJSmithCommented:

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
 
tel2Commented:
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
 
nilehawkCommented:
don't apply any lock method to life system you need to test it first on test plant
good luck
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now