/etc/X11/Xsession.d/10debian-edu-one-login-per-host is in debian-edu-config 1.818+deb8u2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #!/bin/sh
# Make sure a given user do not log into the same computer twice.
# When this is done on an LTSP server, the KDE configuration is likely
# to be destroyed.
#
# debug=1
log() {
if [ "$debug" ] ; then
echo "$@"
fi
}
limit_logins()
{
num=1
numps=0
u=$LOGNAME
# Do not try to limit the root user
if [ "$u" != "root" ] ; then
num=`who | cut -d" " -f1 | grep "^$LOGNAME\$" | wc -l`
fi
log "Found $num connections for user $LOGNAME"
if [ "$num" -gt 1 ] ; then
numps=`ps -eu "$LOGNAME" | grep -v -e sleep -e COMMAND|wc -l`
num=`expr $numps + 1`
fi
if [ $num -gt 1 ] ; then
xmessage -buttons Understood:0 -timeout 30 -center \
"You are not allowed to login at more than _one_ thinclient simultaneously."
exit 1
fi
}
# Only enable this if the flag file exists. When the code is tested
# and found to work fine, we can enable it for everyone. [pere 2003-02-21]
# To enable this script you must create an empty file with the command
# touch /etc/debian-edu/limit-logins
# [klaus 2003-09-06]
if [ -f /etc/debian-edu/limit-logins ] ; then
limit_logins
fi
|