Hello all,
I progress slowly in my installation of Samba; but I'm confronted to two problems:
1) Is it possible to configure Samba (4.1.7) directly from GNU/Linux (CentOS 6.5) for automatically mount the user's home directory to "H:" when he connects to the domain ?
2) In addition, after that, I'll try to set up profiles' roaming.
Here's my files:
---------------------------------------------- smb.conf (simplified after many tests) ----------------------------------------------
# Global parameters [global] #general naming workgroup = ADS realm = ADS.LOCAL netbios name = SERVER server string = File Server
#logging log file = /usr/local/samba/var/log/%m.log max log size = 50 log level = 8
server role = active directory domain controller dns forwarder = 172.16.130.7 idmap_ldb:use rfc2307 = yes
# These (uncommented) lines changes nothing # add user script = /usr/local/samba/sbin/add-user-script.sh %D %U %L #logon script = logon.bat #logon path = \%L\profile\%U #logon drive = H:
[netlogon]
# this line isn't root preexec = /bin/bash /usr/local/samba/sbin/create-profile-directory.sh %D %U %L path = /usr/local/samba/var/locks/sysvol/ads.local/scripts read only = No #browsable=yes is for test only browsable=yes
[sysvol] path = /usr/local/samba/var/locks/sysvol read only = No browsable=No
[profile] comment = Roaming profiles path = /home/%D/profiles/ #browsable=yes is for test only browsable = yes writable = yes
[homes] comment = %S's home root preexec = /bin/bash /usr/local/samba/sbin/create-home-directory.sh %D %S path = /home/%D/files/%S browsable = no
---------------------------------------------- create-home-directory.sh : ----------------------------------------------
#!/bin/bash
if [ ! -e /home/$1/files/$2 ]; then mkdir -p /home/$1/files/$2
chmod 775 /home/$1/files/$2 chown $2:"Domain Users" /home/$1/files/$2 fi
exit 0
---------------------------------------------- create-profile-directory.sh : ----------------------------------------------
#!/bin/bash
if [ ! -e /home/$1/profiles/$2 ]; then mkdir -p /home/$1/profiles/$2
chmod 775 /home/$1/profiles/$2 chown $2:"Domain Users" /home/$1/profiles/$2 pdbedit -u $2 -D "H:" -S "\$3\netlogon\logon.bat" -h "$3\$2 fi
exit 0
---------------------------------------------- add-user-script.sh: ----------------------------------------------
#!/bin/bash
/usr/sbin/useradd -s /bin/false -d /home/$1/files/$2 -m $2 pdbedit -u $2 -D "H:" -S "\$3\netlogon\logon.bat" -h "$3\$2
---------------------------------------------- logon.bat: ----------------------------------------------
net use h: %LOGONSERVER%%USERNAME%
-----------------------------------------------
Regards.
Pascal Blétard
From: Pascal Blétard paddelman@hotmail.com
- Is it possible to configure Samba (4.1.7) directly from GNU/Linux (CentOS
6.5) for automatically mount the user's home directory to "H:" when he connects to the domain ?
This worked for me:
/etc/samba/smb.conf logon script = logon.bat logon path = \%L\Profiles%U logon home = \%L%U logon drive = h:
[netlogon] path = /home/SAMBA/netlogon/ browseable = no read only = yes write list = Administrator root @smb-admin
/home/SAMBA/netlogon/logon.bat net use H: \FILER\home net time \FILER /set /yes
JD
Date: Thu, 5 Jun 2014 05:39:47 -0700 From: jdmls@yahoo.com Subject: Re: [Samba] Samba 4.1.7 + CentOS 6.5 - Home's directory mounting in W7 + Roaming of Profils To: paddelman@hotmail.com; centos@centos.org From: Pascal Blétard paddelman@hotmail.com
- Is it possible to configure Samba (4.1.7) directly from GNU/Linux (CentOS
6.5) for automatically mount the user's home directory to "H:" when he connects to the domain ?
This worked for me:
/etc/samba/smb.conf logon script = logon.bat logon path = \%L\Profiles%U logon home = \%L%U logon drive = h:
[netlogon] path = /home/SAMBA/netlogon/ browseable = no read only = yes write list = Administrator root @smb-admin
/home/SAMBA/netlogon/logon.bat net use H: \FILER\home net time \FILER /set /yes
JD
Hello Thank you for your reply.
I tried it first, but this seems doesn't working for me :/
- Can you send me your whole smb.conf (in particular for "sysvol" and "global" shares) - Which OS on client? Win7 ? - What's your distro GNU/Linux? - Is it a for samba dedicated server? If yes, what's your dependances list ? - I haven't the "smb-admin" group, have you created it? - Which are your compilation's options for samba ? - Which are your options for domain provision ?
I don't know why my environment differs of yours
Regards
Pascal Blétard
On 6/5/2014 9:29 AM, Pascal Blétard wrote:
Date: Thu, 5 Jun 2014 05:39:47 -0700 From: jdmls@yahoo.com
I tried it first, but this seems doesn't working for me :/
- Can you send me your whole smb.conf (in particular for "sysvol" and "global" shares)
- Which OS on client? Win7 ?
- What's your distro GNU/Linux?
- Is it a for samba dedicated server? If yes, what's your dependances list ?
- I haven't the "smb-admin" group, have you created it?
- Which are your compilation's options for samba ?
- Which are your options for domain provision ?
I don't know why my environment differs of yours
I think JD's setup is for samba3. Samba4 is written mainly for Active Directory emulation - much more setup stuff is needed.
You should really be reading the samba4 wiki & email list. There's been much work done lately to make the docs on the wiki more coherent and usable.