[Samba] Samba 4.1.7 + CentOS 6.5 - Home's directory mounting in W7 + Roaming of Profils

Daniel Müller mueller at tropenklinik.de
Thu Jun 5 06:18:45 MDT 2014


[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

Just use [home]
read only=no

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 Rowland Penny
Gesendet: Donnerstag, 5. Juni 2014 14:13
An: samba at lists.samba.org
Betreff: Re: [Samba] Samba 4.1.7 + CentOS 6.5 - Home's directory mounting in
W7 + Roaming of Profils

On 05/06/14 12:02, Pascal Blétard wrote:
> 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
>
>   		 	   		
OK, remove just about everything that you have added to your smb.conf and
then go and spend some time reading the samba wiki, you are doing everything
wrong!

Rowland
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba



More information about the samba mailing list