<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi Martin,<br>
<br>
Thanks I'm trying the script but I've run into two problems;<br>
<br>
1) After changeing the paths for linux and adding a ";" and "done" 
please see code <br>
<br>
<pre wrap=""># 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/}" <big><b><font  color="#ff0000">;</font></b></big>
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
<big><b><font color="#ff0000">done</font></b></big>
</pre>
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 ......<br>
<br>
Second where do I put this scrip in /etc/profile ? or as an independent
executable ??<br>
<br>
thanks for the help<br>
norbert<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:sysadmin@handsworth.bham.sch.uk">sysadmin@handsworth.bham.sch.uk</a> wrote:<br>
<blockquote type="cite"  cite="mid200409211344.16448.sysadmin@handsworth.bham.sch.uk">
  <pre wrap="">On Tuesday 21 Sep 2004 12:48 am, norbert wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">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!!!
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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

  </pre>
</blockquote>
</body>
</html>