[K12OSN] Multiple logins ???

Martin Woolley sysadmin at handsworth.bham.sch.uk
Tue Sep 21 12:44:16 UTC 2004


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

-- 
Regards
Martin Woolley
ICT Support
Handsworth Grammar School
Isis Astarte Diana Hecate Demeter Kali Inanna



*************************************************************
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity 
to whom they are addressed. If you have received this email 
in error please notify postmaster at bgfl.org

The views expressed within this email are those of the 
individual, and not necessarily those of the organisation
*************************************************************





More information about the K12OSN mailing list