1753773 Members
5722 Online
108799 Solutions
New Discussion юеВ

Limiting UNIX Logins

 
SOLVED
Go to solution
rmueller58
Valued Contributor

Limiting UNIX Logins

I noticed a post regarding limiting UNIX logins.

From Rodney Hills on 12/08/2000 I downloaded the AWK script, I am assuming the name of the awk script is check.dup.login?

I am interested in keeping people from logging in multiple times or with multiple VT sessions.

Any thoughts and info would be appreciated.
I would gather that I could change the initial variables in the AWK script,

5 REPLIES 5
Rick Garland
Honored Contributor

Re: Limiting UNIX Logins

As another option, the user is part of a group. The $HOME/.profile of the user is doing the grget command. If the user happens to be in a specific group, do not allow more than one login.
rmueller58
Valued Contributor

Re: Limiting UNIX Logins

the grget will get group assignments. Is there a way to assign a single login to a group?

any thoughts?

Thanks again..
Sam Nicholls
Trusted Contributor
Solution

Re: Limiting UNIX Logins

Maybe something like this would work. In the system-wide /etc/profile and /etc/csh.cshrc scripts, do...

who | grep `whoami` | wc -l

and exit if > 1.

-sam
Leigh Williams
Occasional Contributor

Re: Limiting UNIX Logins

Rex,

We use this scenario in our /etc/profile

num=1
u=$LOGNAME
case "$u" in

# Admin etc allowed multiple logins
'leighmw' |'root'|'bsp')
num=1;;

# All other users get 1 login only !
*)
num=`who | cut -d" " -f1 | grep "^$LOGNAME"$|wc -l`
esac

if [ $num -gt 1 ]
then
echo You are already logged into this system
echo Please close your existing session before
echo trying again.
exit
fi
rmueller58
Valued Contributor

Re: Limiting UNIX Logins

thanks