The Limits idea did not work. Maybe I am not too sure on how to do, however I found a solution for
Limiting Logon Connections at
http://us4.samba.org/samba/docs/man/...html#id2655826 and this is what I did but need help understanding what I did.
I created/copied a script "PermitSingleLogon.sh" with permissions 755 and placed it in the /etc/samba directory. Here is the script
#!/bin/bash
IFS="-"
RESULT=$(smbstatus -S -u $1 2> /dev/null | awk 'NF > 6 {print $1}' | sort | uniq -d)
if [ "X${RESULT}" == X ]; then
exit 0
else
exit 1
fi
Then I added the two lines to my netlogon share in the smb.conf file
[netlogon]
...
preexec script = /etc/samba/PermitSingleLogon.sh
preexec close = Yes
...
This works but only if the user tries to logon on the different machines within a few minutes after the initial logon (I will time this later). The Samba-HOW-TO link I used says "
This is not a perfect solution because Windows clients can drop idle connections with an auto-reconnect capability that could result in the appearance that a share is no longer in use, while actually it is"
QUESTIONS:
1. How do I stop Windows form dropping the connection?
2. I have already checked the man pages but still need to know,
What does this part of the above script do? awk 'NF > 6 {print $1}'
and if [ "X${RESULT}" == X ]