Re: aix shell script
dfrench_at_mtxia.com
Date: 12/11/04
- Previous message: Nigel P. Longbottom: "Re: Upgrade from 4.3.3 to 5.2 question"
- In reply to: roger1991_at_hotmail.com: "aix shell script"
- Next in thread: Randy Styka: "Re: aix shell script"
- Reply: Randy Styka: "Re: aix shell script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 10 Dec 2004 15:35:59 -0800
roger1991@hotmail.com wrote:
> I need a shell script to stop duplicate concurrent logins. I need a
> second script to timeout a logged in inactive user after a
> predetermined time limit.
> Thanks for your help.
Procedure to limit logins to 1 login per user:
1. Create the following script:
/usr/bin/Block_user
---- Cut Here ----
#!/bin/ksh
USER="${1}"
NUM=$( who | grep ${USER} | cut -c1-8 | wc -l )
(( NUM < 1 )) && exit 0
print "Permission Denied ... ${NUM} is the limit of logins"
exit 1
---- Cut Here ----
chmod 555 /usr/bin/Block_user
2. Edit "/etc/security/login.cfg" and change the following lines:
* auth_method:
* program =
to
auth_method:
program = /usr/bin/Block_user
3. Edit "/etc/security/user" and change the auth1 line to:
default:
auth1 = SYSTEM,auth_method
4. "root" should be set as an exception to this rule:
root:
auth1 = SYSTEM
5. Existing user stanzas that should be limited, should be changed
to:
auth1 = SYSTEM,auth_method
-- Dana French
- Previous message: Nigel P. Longbottom: "Re: Upgrade from 4.3.3 to 5.2 question"
- In reply to: roger1991_at_hotmail.com: "aix shell script"
- Next in thread: Randy Styka: "Re: aix shell script"
- Reply: Randy Styka: "Re: aix shell script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|