Connection per user

Hello,

Our user using xterm to connect to out host.
How to limit the number of connection per user connecting to our host?

Thanks

The only way I see:
Add in /etc/profile : # this will disallow more than 2 connections...

NO=`who -R |grep $LOGNAME|wc -l`
if [ $NO -ge 2 ]
then
echo "2 connections maximum allowed"
exit 1
fi

# You can try and put it in the .profile of the user but then siice he is the owner, he can always remove what you insert... no easy solution...

best regards

Thank you for your help vbe,
This solution may help us a lot.