Logon script / automatic logon


I’m setting up a Samba server and up to this moment I can share several folders and I can secure them with the smbpasswd users. Now I’ve read stuff about automatic logon scripts on the Windows client. But, how does this work? Do they automatically login with the Windows user or do I still have to make users on the server? Also, does anyone know a good link on how to configure the scripts? It’s also a part of my school project but I want to use it at home too so. I’ve googled alot but most of the tutorials I find are on Ubuntu. (I’ve configured the samba server manually, with the smb.conf document because I have to know how it really works)

I really need some explanation for this.


On 2013-04-03 15:16, Flexxzor wrote:
> Now I’ve read
> stuff about automatic logon scripts on the Windows client.

AFAIK this requires AD on a Windows Domain Server. Samba 4 may support
some of this.

Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

it is possible to have logon scripts with samba 3 also when samba server acts as a domain controller: http://www.samba.org/samba/docs/using_samba/ch04.html

But how does this work in general? I don’t seem to understand the working of it. Where do the users come from then and how does it happen?


Ok I’ve found a good tutorial but there are still some problems. I follow this tutorial: Samba 3 as PDC ~ Linux Tutorials
Now, I did everything, even copied all his commands and settings in the smb.conf document but I can’t seem to connect to the domain on my client.

This is my setup:
Server: opensuse 12.3

Client: windows 8

When I connect to the domain ‘EXAMPLE’ as it is written in the smb.conf, I get a login screen, type in ‘user1’ + password and it gives me the following error:

*The following error occured attempting to join the domain “EXAMPLE”:
The specified domain either does not exist or could not be contacted.

*Is this a problem with my samba config or is it an IP issue? I can ping between the 2 machines.


Important: I do not have or use any MS systems. I have never seen MS Windows 8. In the past I have configured Samba to replace primary and backup domain controllers for MS Win 95 and XP clients.

I do not understand what you mean here. My recollection is that in MS land “personal” clients can join an IBM style Lanman “workgroup”, and that “professional” clients log into a domain. The latter is done by selecting the domain, as opposed to “local” before entering the username and password. The stuff about joining the client to the domain is done with an local admin login. This should be in the MS documentation. The Samba docs are pretty clear about setting up a domain controller, or there is always YaST.

You should try to use the Samba and openSuSE documentation. References to Centos or other sources are not so helpful. If you do decide to use non-native methods it would help if you describe exactly what you did, and what happened.

Thanks for replying.

The Windows 8 client I’m using is an enterprise version. Basically the usage of windows 8 is exactly the same as win xp and 7. Just open up system properties and change the domain name. That is what I did. I set WORKGROUP = EXAMPLE and all the domain settings.

My smb.conf:

workgroup = EXAMPLE
#corresponds to domain name
local master = yes
preferred master = yes
domain master = yes
domain logons = yes
security = user
passdb backend = tdbsam
logon path = \%L\Profiles%U
logon script = logon.bat
add machine script = /usr/sbin/useradd -d /dev/null -g 200 -s /sbin/nologin -M %u

So now I go to the system properties and enter ‘EXAMPLE’ in the domain string on the win client. Then it gives me that error. Also, I’ve tried logging in with the previously made account as described on the tutorial.
I’ve also tried following this tutorial: openSUSE 12.3: Chapter 19. Samba but it didn’t work either.