[Samba] deny second or multiple logins
Helmut Hullen
Hullen at t-online.de
Mon Apr 2 12:33:00 GMT 2007
Hallo, Marcus,
Du (lists) meintest am 02.04.07:
>>> http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/Advanced
>>> NetworkManagement.html#id386516
> my script:
> preexec script = /path/PermitSingleLogon.sh '%U'
> preexec close = Yes
> ----------
> #!/bin/bash
> RESULT=$(smbstatus -d0 -b -u $1 2> /dev/null | grep $1)
> if [ "X${RESULT}" == X ]; then
> exit 0
> else
> exit 1
> fi
> ----------
Try
... | grep -c $1)
and then
test "$RESULT" -le 1 || exit 1
exit 0
Then "prexec close = yes" blocks the second (and all further) login.
Viele Gruesse!
Helmut
More information about the samba
mailing list