Re-2: [Samba] limit login

Cybionet cybionet at
Thu Sep 6 10:09:18 GMT 2007

Greeting Pascal,

Here a code I have made yesterday. It's surely not a great piece of 
code, but it's work with Windows client.

First in the netlogon section of your smb.conf, add the line:

root preexec = /pathof the scripts/ %u %m

I don't have try this script with the log  level with another value than 
0. ( log level = 0 passdb:4 auth:4 vfs:2). The result of smbstatus was 
different. Create now a script named A error I can see is the 
out.txt if multiple user log in the same tome. Maybe change this by %u.txt.

#! /bin/bash


if `smbstatus -Sp | grep "${username}" | grep -v "${machine}" 
1>/dev/null 2>&1`
   #echo "Deja connecte"
   smbstatus -Sp | grep "${machine}" 1>/dev/null 2>&1 >out.txt
   PID =`gawk -F: '{ print $1 }' out.txt | cut -d " " -f1`
   kill $PID
   #echo "Nouvelle connexion"
   exit 0

au plaisir,


Cybionet - Solution reseautique

More information about the samba mailing list