Pascal Blétard
2014-May-27 11:00 UTC
[Samba] CentOS 6.5 + Samba 4.1.6 - Variable Substitution (smb.conf)
Hello everyone. So, I come to you because I have a little problem when setting up my domain controller based on CentOS 6.5 and Samba 4.1.6. Everything works well, except for one small detail, which in my case blocking me. I would like to automatically generate the home directory of the user during the first connection (from Win or Linux), but the problem is that for some unknown reason, the variable substitution does not work in the smb.conf I tested various alternatives for the user name, for example, but none works. Here is my smb.conf [global] workgroup = ADS realm = ADS.LOCAL netbios name = BOOS17 server role = active directory domain controller dns forwarder = 172.16.130.7 server services = rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbind, ntp_signd, kcc, dnsupdate, dns, smb dcerpc endpoint servers = epmapper, wkssvc, rpcecho, samr, netlogon, lsarpc, spoolss, drsuapi, dssetup, unixinfo, browser, eventlog6, backupkey, dnsserver, winreg, srvsvc idmap_ldb:use rfc2307 = yes [netlogon] path = /usr/local/samba/var/locks/sysvol/ads.local/scripts read only = No [sysvol] path = /usr/local/samba/var/locks/sysvol read only = No [home] comment = %U %USERNAME% %ACCOUNTNAME% %USERACCOUNT% %u Home Directory path = /home/ADS read only = No [Global Share] comment = Global %D %DOMAIN% %DOMAINNAME% Share path = /home/globalshare valid users = User1 read list = User1 write list = User1 read only = No guest ok = Yes None of the variables used is replaced. Here is the result of an example smbclient command: # smbclient -L localhost -U Administrator -c 'ls' Enter Administrator's password: Domain=[ADS] OS=[Unix] Server=[Samba 4.1.6] Sharename Type Comment --------- ---- ------- netlogon Disk sysvol Disk home Disk %U %USERNAME% %ACCOUNTNAME% %USERACCOUNT% %u Home Directory Global Share Disk Global %D %DOMAIN% %DOMAINNAME% Share IPC$ IPC IPC Service Domain=[ADS] OS=[Unix] Server=[Samba 4.1.6] Server Comment --------- ------- Workgroup Master --------- ------- I dont really know where the problem is. Someone would have an idea?
Daniel Müller
2014-May-27 12:25 UTC
[Samba] CentOS 6.5 + Samba 4.1.6 - Variable Substitution (smb.conf)
Just use prexec=syourscriptname/command In your [home] section. Or login to a admin pc start rsat and choose the user, properties profile there connect to: \\yourdc\home\%username% EDV Daniel M?ller Leitung EDV Tropenklinik Paul-Lechler-Krankenhaus Paul-Lechler-Str. 24 72076 T?bingen Tel.: 07071/206-463, Fax: 07071/206-499 eMail: mueller at tropenklinik.de Internet: www.tropenklinik.de -----Urspr?ngliche Nachricht----- Von: samba-bounces at lists.samba.org [mailto:samba-bounces at lists.samba.org] Im Auftrag von Pascal Bl?tard Gesendet: Dienstag, 27. Mai 2014 13:00 An: samba at lists.samba.org Betreff: [Samba] CentOS 6.5 + Samba 4.1.6 - Variable Substitution (smb.conf) Hello everyone. So, I come to you because I have a little problem when setting up my domain controller based on CentOS 6.5 and Samba 4.1.6. Everything works well, except for one small detail, which in my case blocking me. I would like to automatically generate the home directory of the user during the first connection (from Win or Linux), but the problem is that for some unknown reason, the variable substitution does not work in the smb.conf I tested various alternatives for the user name, for example, but none works. Here is my smb.conf [global] workgroup = ADS realm = ADS.LOCAL netbios name = BOOS17 server role = active directory domain controller dns forwarder = 172.16.130.7 server services = rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbind, ntp_signd, kcc, dnsupdate, dns, smb dcerpc endpoint servers = epmapper, wkssvc, rpcecho, samr, netlogon, lsarpc, spoolss, drsuapi, dssetup, unixinfo, browser, eventlog6, backupkey, dnsserver, winreg, srvsvc idmap_ldb:use rfc2307 = yes [netlogon] path = /usr/local/samba/var/locks/sysvol/ads.local/scripts read only = No [sysvol] path = /usr/local/samba/var/locks/sysvol read only = No [home] comment = %U %USERNAME% %ACCOUNTNAME% %USERACCOUNT% %u Home Directory path = /home/ADS read only = No [Global Share] comment = Global %D %DOMAIN% %DOMAINNAME% Share path = /home/globalshare valid users = User1 read list = User1 write list = User1 read only = No guest ok = Yes None of the variables used is replaced. Here is the result of an example smbclient command: # smbclient -L localhost -U Administrator -c 'ls' Enter Administrator's password: Domain=[ADS] OS=[Unix] Server=[Samba 4.1.6] Sharename Type Comment --------- ---- ------- netlogon Disk sysvol Disk home Disk %U %USERNAME% %ACCOUNTNAME% %USERACCOUNT% %u Home Directory Global Share Disk Global %D %DOMAIN% %DOMAINNAME% Share IPC$ IPC IPC Service Domain=[ADS] OS=[Unix] Server=[Samba 4.1.6] Server Comment --------- ------- Workgroup Master --------- ------- I dont really know where the problem is. Someone would have an idea? -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
Andrew Bartlett
2014-May-29 00:41 UTC
[Samba] CentOS 6.5 + Samba 4.1.6 - Variable Substitution (smb.conf)
On Tue, 2014-05-27 at 13:00 +0200, Pascal Bl?tard wrote:> Hello everyone. > > So, I come to you because I have a little problem when setting up my domain controller based on CentOS 6.5 and Samba 4.1.6. > > Everything works well, except for one small detail, which in my case blocking me. > > I > would like to automatically generate the home directory of the user > during the first connection (from Win or Linux), but the problem is that > for some unknown reason, the variable substitution does not work in the > smb.conf > > I tested various alternatives for the user name, for example, but none works. > > Here is my smb.conf > > > [global] > > workgroup = ADS > > realm = ADS.LOCAL > > netbios name = BOOS17 > > server role = active directory domain controller > > dns forwarder = 172.16.130.7 > > server services = rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbind, ntp_signd, kcc, dnsupdate, dns, smbYou are using the ntvfs file server. This does not support variable substitution, nor prexec or many other features. It is supported, but not recommended for new installs for exactly this reason. Use s3fs (the default) and you can expect more success I hope this clarifies things, Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba