[K12OSN] Multiple logins UPDATE

norbert bear2bar at netscape.net
Thu Sep 30 01:07:10 UTC 2004


Hi,

Thanks for the suggestion but I'm no further ahead.. well... at least 
users can still login, the same user can login multiple times .
The script give me an "syntax error: unexpected end of file"
What I need is also select the group that the users belong to prior to 
limiting their login, ie if 'groups | grep -q rhsstudents' then limit 
the login.

What should be a simple task has turned into a nightmare .....

thks again for all the help
norbert

goblin at scooter.co.nz wrote:

> norbert wrote:
>
>> Hi Les,
>>
>> Well I've tried that script over and over but I get the same result ! 
>> Once it runs and I restart dhcpd & xinetd none of the terminals can 
>> login. The part for the groups seems to be good but it's of little 
>> use if no one can login....  BTW I'm running this on a test machine ...
>>
>
> Probably getting headers from ps (use the "h" option)
>
> anyways try this see if it works
>
>
> ==========================8<==============================
> #!/bin/sh
>
>
> TTY="$(tty)"
> my_tty="${TTY##/dev/}"
>
> if [ -n "$(ps -u $LOGNAME h | grep -v $my_tty)" ]; then
> cat << EOF
>
>       You already have an active session on this system and you are
>       allowed a single session.  This session will now be closed
>
> EOF
>
> sleep 2
>
> exit
>
> fi
> ===============================>8============================
>
>
>
> mRgOBLIN
>
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>




More information about the K12OSN mailing list