[Samba] netlogon.bat issues

Dale Schroeder dale at BriannasSaladDressing.com
Thu Aug 20 14:29:56 MDT 2009


David Christensen wrote:
> Dale Schroeder wrote:
>   
>> David,
>>
>> Your netlogon share is more complicated than most.
>> Consider initially commenting out all the mask and mode parameters and the valid users parameter.
>> If it then works, add them back one at a time until it breaks.
>>
>> Depending on what the global preexec script does, you may want to initially disable that also.
>>
>> Check that the execute bit is set on the .bat files.  I used 755 permissions with root:root ownership.
>> Check the permissions throughout the entire netlogon path (/mnt/samba/netlogon).
>> Were the files created in a DOS/Windows editor?
>>
>> Dale
>>
>>
>> David Christensen wrote:
>>
>> David Christensen wrote:
>>
>>
>> I have samba configured so that users have their own netlogon.bat file
>> (e.g. %U.bat) and each user has a .bat with their username in the
>> netlogon share.
>>
>> So far I have been unable to get any of the shares that I have defined
>> in the batch file to be mounted when a user logs in.  Here is a snapshot
>> of both the netlogon section of my smb.conf file and the %U.bat file I
>> am using:
>>
>> smb.conf:
>>
>> [global]
>> .......
>> preexec = /usr/local/bin/netlogon %U
>> logon script = %U.bat
>> logon home = \\%L\%U\.profiles
>> logon path = \\%L\profiles$\%U
>> logon drive = Z:
>>
>> ........
>>
>> [netlogon]
>> path = /mnt/samba/netlogon
>> admin users = root, Administrator, Admin
>> valid users = %U
>> read only = no
>> browsable = no
>> create mask = 0770
>> force create mode = 0060
>> create directory mask = 0770
>> force directory mode = 0070
>> security mask = 0777
>> directory security mask = 0777
>>
>> %U.bat:
>> @echo off
>> REM # In this example it is assumed the smb.conf handles home drive mapping
>> REM # All users get access to Common drive
>> net use Y: \\192.168.155.20\common
>>
>>
>> REM # Lastly lets set the davidc's time to 192.168.155.20's time
>> net time \\192.168.155.20 /set /yes
>>
>>
>>
>> Updated info
>>
>> The user can run the batch file manually from the netlogon share, so the
>> issue seems to be with it running automatically, is there any logs that
>> would capture an attempt to execute this file?
>>     
Determined by the "log file" and "log level" parameters, usually located 
in /var/log/samba.
>
> The preexec script actually creates a netlogon.bat file for each user
> when they log in and sets the file ownership to that of the user logging
> in.  So the batch file is being created by the Linux server.  Since I
> can execute the bat files manually via a command line on an XP host,
> wouldn't that mean that the file is ok?
>   
Everything I've read says the logon scripts have to be in DOS format.  
Here's one example of that admonition:
http://oreilly.com/catalog/samba/chapter/book/ch06_06.html

To keep it automated, you could add a unix2dos command in the script.
> I commented everything you mentioned out and changed the file
> permissions, still not playing fair.
>   
The other parameters you provided look fairly standard.

Dale
> David
>   


More information about the samba mailing list