[K12OSN] Multiple logins ???

norbert bear2bar at netscape.net
Tue Sep 21 15:33:14 UTC 2004


Hi Martin,

Thanks I'm trying the script but I've run into two problems;

1) After changeing the paths for linux and adding a ";" and "done"  
please see code

# This user is only allowed a single login instance
tty=`/usr/bin/tty`     # Get tty to test for multiple login

if /bin/ps -u $LOGNAME | /bin/grep -v UID | /bin/grep -v "${tty##/dev/}" ;
then
       /bin/cat <<-EOM >&2

       You already have an active session on this system and you are
       allowed a single session.  This session will now be closed.

       EOM
       wait
       exit
fi
done

I saved the script and tried running it alone I get  "line 16: syntax 
error: unexpected end of file" can the error be clarified and corrected 
please as it looks correct ......

Second where do I put this scrip in /etc/profile ? or as an independent 
executable ??

thanks for the help
norbert

sysadmin at handsworth.bham.sch.uk wrote:

>On Tuesday 21 Sep 2004 12:48 am, norbert wrote:
>  
>
>>Hi,
>>
>>i'd like to thank everyone for all the good tips, now the massive work
>>starts.
>>
>>Now how can we prevent the same user from logging in to different
>>workstations without "killing" the first instance ?
>>
>>Please all suggestions are welcomed, this has become a real problem!!!
>>    
>>
>
>We used to do this on AIX boxes; I haven't tried this under Linux but there it 
>*should* work with some changes to paths - YMMV
>
>Some code to prevent multiple logins (for /etc/profile or .profile)
>
># This user is only allowed a single login instance
>tty=`/usr/bin/tty`     # Get tty to test for multiple login
>if /usr/bin/ps -u $LOGNAME | /usr/bin/grep -v UID | /usr/bin/grep -v 
>"${tty##/dev/}"
>then
>       /usr/bin/cat <<-EOM >&2
>
>       You already have an active session on this system and you are
>       allowed a single session.  This session will now be closed.
>
>       EOM
>       wait
>       exit
>fi
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/k12osn/attachments/20040921/8a6f64b7/attachment.htm>


More information about the K12OSN mailing list