Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 08/05/2007, à 15:13

naunheim

[samba + LDAP] Ajouter domaine sur client windows

Bonjour à tous !

Voila plusieurs jours que je planche sur mon serveur PDC samba avec authentification par LDAP.

Après avoir configurer pas mal de fichiers par-ci par-là, en suivant plusieurs tutoriaux, je parviens à me connecter à un partage samba, depuis un poste Linux (smbclient, smbmount). L'authentification par LDAP fonctionne bien, pas de soucis.

Lorsque je vais sur un poste client windows, si je tente de me connecter à un partage en passant par un explorer et en tapant comme adresse //adresse_ip/nom_du_partage cela fonctionne également.

Là où le bas blesse, c'est lorsque je veux ajouter la machine windows au domaine Samba. Je fais un clic droit sur le poste de travail, je choisis l'onglet "nom de l'ordinateur", puis modifier. Dans la case "domaine", je mets le nom workgroup que j'ai indiqué dans mon smb.conf. Je saisis mon login et mon mot de passe.

Là, j'ai un message d'erreur qui me dit qu'une erreur s'est produite, et que mon nom d'utilisateur est introuvable.

Au niveau des logs, j'ai le fichier /var/log/samba/log.[nom de ma machine] qui dit :

[2007/05/08 15:06:25, 0] passdb/pdb_interface.c:pdb_default_create_user(368)
  _samr_create_user: Running the command `/usr/sbin/smbldap-useradd -w "vwxp$"' gave 9

Je tente donc d'utiliser la commande smbldap-useradd -w "vwxp$" directement en console. Et il me répond que l'utilisateur (en fait, la machine) vwxp existe déjà (ce qui est normal puisque je l'avais déjà ajouté à la main). Je retrouve le code de retour égale à 9. Mais je ne sais pas ce qui ne fonctionne pas...

SI quelqu'un peut m'aiguiller sur la solution, ce serait sympa smile

Si vous avez besoin d'extrait de mes fichiers de conf, il suffit de demander.

Merci d'avance

naunheim

#2 Le 08/05/2007, à 16:08

figaro

Re : [samba + LDAP] Ajouter domaine sur client windows

Si ton Windows est une édition familiale cela n'est pas possible car cette édition ne gère pas les domaines.


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#3 Le 08/05/2007, à 16:24

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

Je suis bien sous xp Pro.

Je pense que si j'étais sous familial, je n'aurais même pas eu la fenêtre donnant la possibilité de changer le domaine ?

Enfin de toutes façons, je suis sous XP ;-)

#4 Le 08/05/2007, à 19:21

chapi

Re : [samba + LDAP] Ajouter domaine sur client windows

Bonjour,

Lorsque tu joins le domaine, tu utilises bien l'utilisateur root ?
Tu as bien un utilisateur Samba root dans ta base LDAP ?
Tu as utilisé smbldap-populate pour remplir ton annuaire ?

Je veux bien ton smb.conf, ton slapd.conf et le fichier de configuration principal des Samba-LDAP tools.
Je veux bien aussi que tu me dises quels tutos tu as suivi s'il te plait.

Hors ligne

#5 Le 09/05/2007, à 21:04

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

Salut,

Alors d'abord, merci pour ta réponse.

Alors, pour me connecter, j'utilise bien l'utilisateur root qui est dans mon LDAP. Résultat d'une recherche sur cet utilisateur :

# root, Users, lo51.utbm.fr
dn: uid=root,ou=Users,dc=lo51,dc=utbm,dc=fr
cn: root
sn: root
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: sambaSamAccount
objectClass: posixAccount
objectClass: shadowAccount
gidNumber: 0
uid: root
uidNumber: 0
homeDirectory: /home/root
sambaLogonTime: 0
sambaLogoffTime: 2147483647
sambaKickoffTime: 2147483647
sambaPwdCanChange: 0
sambaPwdMustChange: 2147483647
sambaPrimaryGroupSID: S-1-5-21-2724949372-1191343341-1524453202-512
sambaAcctFlags: [U          ]
sambaSID: S-1-5-21-2724949372-1191343341-1524453202-500
loginShell: /bin/false
gecos: Netbios Domain Administrator
sambaLMPassword: B2C55A76424E5677AAD3B435B51404EE
sambaNTPassword: B20C226A2038710EBD769AFDBD8C0998
sambaPwdLastSet: 1178627733
userPassword:: e1NTSEF9ajZmZ1hreFhZNngyeHd4cGx2S2FQTXIyTGUxVU5sTTQ=

Cet utilisateur est, semble-t-il, bien membre du groupe Domain Admins :

# Domain Admins, Groups, lo51.utbm.fr
dn: cn=Domain Admins,ou=Groups,dc=lo51,dc=utbm,dc=fr
objectClass: top
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 512
cn: Domain Admins
memberUid: root
description: Netbios Domain Administrators
sambaSID: S-1-5-21-2724949372-1191343341-1524453202-512
sambaGroupType: 2
displayName: Domain Admins



Pour remplir mon annuaire, j'ai d'abord utilisé les migrationtools, puis j'ai utilisé smbldap-populate.



Je te donne les fichiers de configuration dans un message juste après pour ne pas rendre celui-ci trop illisible.

#6 Le 09/05/2007, à 21:12

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

Alors, tout d'abord, le smb.conf :

20:59 root@naunheimBox ~# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[home]"
Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
Press enter to see a dump of your service definitions

[global]
        workgroup = LO51.UTBM.FR
        server string = %h server Sambe-LDAP
        passdb backend = ldapsam:ldap://127.0.0.1
        passwd program = /usr/sbin/smbldap-passwd -u %u
        passwd chat = *New*password* %n\n *Retype*new*password* %n\n *all*authentication*tokens*updated*
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        add user script = /usr/sbin/smbldap-useradd -m "%u"
        delete user script = /usr/sbin/smbldap-userdel "%u"
        add group script = /usr/sbin/smbldap-groupadd -p "%g"
        delete group script = /usr/sbin/smbldap-groupdel "%g"
        add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
        delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
        set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
        add machine script = /usr/sbin/smbldap-useradd -w "%u"
        logon drive = U:
        domain logons = Yes
        os level = 40
        domain master = Yes
        dns proxy = No
        wins support = Yes
        ldap admin dn = cn=admin,dc=lo51,dc=utbm,dc=fr
        ldap delete dn = Yes
        ldap group suffix = ou=Groups
        ldap machine suffix = ou=Machines
        ldap passwd sync = Yes
        ldap suffix = dc=lo51,dc=utbm,dc=fr
        ldap user suffix = ou=Users
        panic action = /usr/share/samba/panic-action %d
        winbind use default domain = Yes
        hosts allow = 192.168.0., 127.
        case sensitive = No

[homes]
        comment = Home Directory
        path = /home/%U
        valid users = %S
        read only = No
        create mask = 0700
        directory mask = 0700
        browseable = No

[home]
        path = /home/
        valid users = %U
        read only = No

#7 Le 09/05/2007, à 21:16

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

Ensuite, le slapd.conf :

21:07 root@naunheimBox ~# cat /etc/ldap/slapd.conf           

allow bind_v2

# Schema and objectClass definitions
include         /etc/ldap/schema/core.schema
include         /etc/ldap/schema/cosine.schema
include         /etc/ldap/schema/nis.schema
include         /etc/ldap/schema/inetorgperson.schema
include         /etc/ldap/schema/samba.schema

# Schema check allows for forcing entries to
# match schemas for their objectClasses's
schemacheck     on

# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile         /var/run/slapd/slapd.pid

# List of arguments that were passed to the server
argsfile        /var/run/slapd/slapd.args

# Read slapd.conf(5) for possible values
loglevel        256

# Where the dynamically loaded modules are stored
modulepath      /usr/lib/ldap
moduleload      back_bdb

#######################################################################
# Specific Backend Directives for bdb:
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
backend         bdb
checkpoint 512 30

# Specific Directives for database #1, of type bdb:
# Database specific directives apply to this databasse until another
# 'database' directive occurs
database        bdb

# The base of your directory in database #1
suffix          "dc=lo51,dc=utbm,dc=fr"

rootdn "cn=admin,dc=lo51,dc=utbm,dc=fr"
rootpw {SSHA}xxx

# Where the database file are physically stored for database #1
directory       "/var/lib/ldap"

# Indexing options for database #1
index           objectClass eq
index           sambaSID        eq
index           sambaDomainName eq
index           sambaPrimaryGroupSID    eq
index cn,sn,uid         pres,sub,eq
index uidNumber,gidNumber,memberUID     pres,eq

# Save the time that the entry gets modified, for database #1
lastmod         on

access to attrs=userPassword,sambaNTPassword,sambaLMPassword
        by dn="cn=admin,dc=lo51,dc=utbm,dc=fr" write
        by anonymous auth
        by self write
        by * none


access to dn.base="" by * read

# The admin dn has full write access, everyone else
# can read everything.
access to *
        by dn="cn=admin,dc=lo51,dc=utbm,dc=fr" write
        by * read



# ACL permettant à l'admin de l'annuaire d'ajouter des utilisateurs
# dans la branche ou=People.
access to dn.children="ou=People,dc=lo51,dc=utbm,dc=fr"
        attrs=entry,children,posixAccount
        by dn="cn=admin,dc=lo51,dc=utbm,dc=fr" write
        by users read
        by anonymous read

# ACL permettant à l'admin de l'annuaire d'ajouter des groupes
# dans la branche ou=Group.
access to dn.children="ou=Group,dc=lo51,dc=utbm,dc=fr"
        attrs=entry,children,posixGroup
        by dn="cn=admin,dc=lo51,dc=utbm,dc=fr" write
        by users read
        by anonymous read

# ACL permettant aux utilisateurs de modifier leurs attributs mail et
# telephoneNumber.
access to dn.children="ou=People,dc=lo51,dc=utbm,dc=fr"
        attrs=mail,telephoneNumber
        by self write
        by dn="cn=admin,dc=lo51,dc=utbm,dc=fr" write
        by users read
        by anonymous read


# ACL permettant à l'admin de l'annuaire d'ajouter des hôtes
# dans la branche ou=Hosts.
access to dn.children="ou=Hosts,dc=lo51,dc=utbm,dc=fr"
        attrs=entry,children,ipHost,device
        by dn="cn=admin,dc=lo51,dc=utbm,dc=fr" write
        by users read
        by anonymous read

Enfin, le smbldap.conf :

21:13 root@naunheimBox ~# cat /etc/smbldap-tools/smbldap.conf
# /etc/smbldap-tools/smbldap.conf

slaveLDAP="192.168.0.2"
slavePort="389"
masterLDAP="127.0.0.1"
masterPort="389"
ldapTLS="0"
verify="require"

SID="S-1-5-21-2724949372-1191343341-1524453202"
suffix="dc=lo51,dc=utbm,dc=fr"
sambaUnixIdPooldn="sambaDomainName=lo51.utbm.fr,${suffix}"
usersdn="ou=Users,${suffix}"
computersdn="ou=Machines,${suffix}"
groupsdn="ou=Groups,${suffix}"
idmapdn="ou=Idmap,${suffix}"
scope="sub"
hash_encrypt="SSHA"
crypt_salt_format="%s"

userLoginShell="/bin/zsh"
userHome="/home/%U"
userHomeDirectoryMode="700"
userGecos="System User"
defaultUserGid="513"
defaultComputerGid="515"
skeletonDir="/etc/skel"
# defaultMaxPasswordAge="45"

with_smbpasswd="0"
smbpasswd="/usr/bin/smbpasswd"

with_slappasswd="0"
slappasswd="/usr/sbin/slappasswd"

#8 Le 09/05/2007, à 21:19

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

Côté tutoriaux, j'ai principalement suivi celui-ci]

J'en ai regardé d'autres, pour me dépanner à certains moments, notamment celui-ci

Voila, désolé d'avoir écrit ça en plusieurs messages, mais avec tous les fichiers de conf, ça passait pas en un seul message.

Merci beaucoup pour ton aide smile

naunheim

#9 Le 10/05/2007, à 21:23

chapi

Re : [samba + LDAP] Ajouter domaine sur client windows

Merci. Je n'ai pas trop le temps ce soir pour regarder tout ça, mais je ne t'oublie pas.

Hors ligne

#10 Le 11/05/2007, à 09:57

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

Pas de soucis, c'est déjà bien sympa que tu m'aides smile

#11 Le 11/05/2007, à 10:04

figaro

Re : [samba + LDAP] Ajouter domaine sur client windows

preferred master =  yes
domain master =  yes
local master = yes

Ces trois paramètres sont indispensables. smile


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#12 Le 11/05/2007, à 22:11

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

Alors, je viens de rajouter le paramètre manquant à mon smb.conf

J'ai désormais dans smb.conf



preferred master = yes
domain master = yes
domain logons = yes
local master = yes

Ce qui est bizarre, c'est que mon testparm ne rend pas le local master = yes

22:09 root@naunheimBox ~# testparm |grep master   
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[home]"
Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
Press enter to see a dump of your service definitions

        preferred master = Yes
        domain master = Yes

J'ai ressayé d'ajouter un client windows au domaine, même résultat qu'avant...

#13 Le 11/05/2007, à 22:45

figaro

Re : [samba + LDAP] Ajouter domaine sur client windows

et avec en plus 

security = domain

Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#14 Le 12/05/2007, à 08:04

figaro

Re : [samba + LDAP] Ajouter domaine sur client windows

et là :

hosts allow = 192.168.0., 127.

ce serait plutot:

hosts allow = 192.168.0.     127.

la virgule sans espace est de trop


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#15 Le 12/05/2007, à 13:24

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

J'ai rajouté le paramètre security = domain

Par contre, il y a un truc que je ne m'explique pas :


13:22 root@naunheimBox ~# cat /etc/samba/smb.conf |grep "hosts allow"
hosts allow = 192.168.0. 127.
13:22 root@naunheimBox ~#

13:22 root@naunheimBox ~# testparm |grep "hosts allow"
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[home]"
Server's Role (logon server) NOT ADVISED with domain-level security
Loaded services file OK.
Server role: ROLE_DOMAIN_BDC
Press enter to see a dump of your service definitions

        hosts allow = 192.168.0., 127.
13:22 root@naunheimBox ~#

Déjà hier, le local master = yes n'apparaissait pas (et il n'apparait toujours pas) dans le résultat de testparm, et maintenant le hosts allow qui ne rend pas la même chose...

Enfin, après un nouveau test, cela ne fonctionne pas

#16 Le 12/05/2007, à 13:27

figaro

Re : [samba + LDAP] Ajouter domaine sur client windows

Eh oui c'est ta virgule ! voir mon post 34. smile

Dernière modification par figaro (Le 12/05/2007, à 13:28)


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#17 Le 12/05/2007, à 14:20

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

figaro a écrit :

Eh oui c'est ta virgule ! voir mon post 34. smile

Mais la virgule, je ne l'ai pas dans mon smb.conf
Regarde mon post juste au-dessus, je te montre la ligne de mon smb.conf avec le hosts allow, et il n'y a pas de virgule. C'est le testparm qui en ajoute une (aucune idée pourquoi).

#18 Le 12/05/2007, à 14:36

figaro

Re : [samba + LDAP] Ajouter domaine sur client windows

Quand je lis ton post 6 où tu as mis ton smb.conf il y a bien la virgule.
Ce n'est pas testparm qui mets une virgule : il la trouve dans ton smb.conf et c'est toi qui l'y a mise cette virgule !

[global]
        workgroup = LO51.UTBM.FR
        server string = %h server Sambe-LDAP
        passdb backend = ldapsam:ldap://127.0.0.1
        passwd program = /usr/sbin/smbldap-passwd -u %u
        passwd chat = *New*password* %n\n *Retype*new*password* %n\n *all*authentication*tokens*updated*
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        add user script = /usr/sbin/smbldap-useradd -m "%u"
        delete user script = /usr/sbin/smbldap-userdel "%u"
        add group script = /usr/sbin/smbldap-groupadd -p "%g"
        delete group script = /usr/sbin/smbldap-groupdel "%g"
        add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
        delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
        set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
        add machine script = /usr/sbin/smbldap-useradd -w "%u"
        logon drive = U:
        domain logons = Yes
        os level = 40
        domain master = Yes
        dns proxy = No
        wins support = Yes
        ldap admin dn = cn=admin,dc=lo51,dc=utbm,dc=fr
        ldap delete dn = Yes
        ldap group suffix = ou=Groups
        ldap machine suffix = ou=Machines
        ldap passwd sync = Yes
        ldap suffix = dc=lo51,dc=utbm,dc=fr
        ldap user suffix = ou=Users
        panic action = /usr/share/samba/panic-action %d
        winbind use default domain = Yes
        hosts allow = 192.168.0., 127.
        case sensitive = No

Dernière modification par figaro (Le 12/05/2007, à 14:38)


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#19 Le 12/05/2007, à 14:45

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

Dans mon post 6, ce n'est pas un cat /etc/samba/smb.conf que j'ai fait pour vous donner la configuration, mais un testparm...

#20 Le 12/05/2007, à 14:47

figaro

Re : [samba + LDAP] Ajouter domaine sur client windows

Fais nous une copie du smb.conf pour voir ?


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#21 Le 12/05/2007, à 14:57

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

ok (j'avais préféré mettre le résultat de testparm pour enlever la quantité de commentaire)

# /etc/samba/smb.conf

# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentary and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
#

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = lo51.utbm.fr
   netbios name=naunheimBox

# server string is the equivalent of the NT Description field
   server string = %h server Sambe-LDAP

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
   wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
;   name resolve order = lmhosts host wins bcast

hosts allow = 192.168.0.    127.
nt acl support = yes
msdfs root = yes

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = true



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
   max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
;   syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
   syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
   security = domain

# You may wish to use password encryption.  See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
   encrypt passwords = yes

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using. 
;   passdb backend = tdbsam

   #obey pam restrictions = yes

;   guest account = nobody
;   invalid users = root

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
;   unix password sync = no

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *New*password* %n\n *Retype*new*password* %n\n *all*authentication*tokens*updated*

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
;   pam password change = no

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
;domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
   logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
   logon drive = U:
   logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
;   load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
;   printing = bsd
;   printcap name = /etc/printcap

# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
;   printing = cups
;   printcap name = cups

# When using [print$], root is implicitly a 'printer admin', but you can
# also give this right to other users to add drivers and set printer
# properties
;   printer admin = @lpadmin


############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/speed.html
# for details
# You may want to add the following on a Linux system:
#         SO_RCVBUF=8192 SO_SNDBUF=8192
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
;   domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash

case sensitive = no
default case = lower
preserve case = yes
short preserve case = yes

passdb backend = ldapsam:ldap://127.0.0.1
obey pam restrictions = no

ldap admin dn = cn=admin,dc=lo51,dc=utbm,dc=fr
ldap suffix = dc=lo51,dc=utbm,dc=fr
ldap machine suffix = ou=Machines
ldap user suffix = ou=Users
ldap group suffix = ou=Groups

ldap delete dn = no

# be a PDC
preferred master = yes
domain master = yes
domain logons = yes
local master = yes
os level = 40
ldap password sync = Yes

# allow user privileges
enable privileges = yes

winbind use default domain = yes

#SMBLDAP-TOOLS
add user script = /usr/sbin/smbldap-useradd -m "%u"
ldap delete dn = yes
delete user script = /usr/sbin/smbldap-userdel "%u"
add machine script = /usr/sbin/smbldap-useradd -w "%u"
add group script = /usr/sbin/smbldap-groupadd -p "%g"
delete group script = /usr/sbin/smbldap-groupdel "%g"
add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
passwd program = /usr/sbin/smbldap-passwd -u %u
#add user script = /usr/sbin/smbldap-useradd -m "%u"
#delete user script = /usr/sbin/smbldap-userdel "%u"
#add machine script = /usr/sbin/smbldap-useradd -w "%u"
#add group script = /usr/sbin/smbldap-groupadd -p "%g"
#delete group script = /usr/sbin/smbldap-groupdel "%g"
#add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
#delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
#set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
#passwd program = /usr/sbin/smbldap-passwd -u %u


#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares.  This will share each
# user's home directory as \\server\username
[homes]
   path = /home/%U
   comment = Home Directory
   browseable = no

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.  Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
   valid users = %S

# By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
   writable = yes


# File creation mask is set to 0600 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0664.
   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
   directory mask = 0700

[home]

   path = /home/
   browseable = yes
   valid users = %U
   writable = yes
   public = no


# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   writable = no
;   share modes = no

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

;[printers]
;   comment = All Printers
;   browseable = no
;   path = /tmp
;   printable = yes
;   public = no
;   writable = no
;   create mode = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
;[print$]
;   comment = Printer Drivers
;   path = /var/lib/samba/printers
;   browseable = yes
;   read only = yes
;   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# Replace 'ntadmin' with the name of the group your admin users are
# members of.
;   write list = root, @ntadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
;   comment = Samba server's CD-ROM
;   writable = no
;   locking = no
;   path = /cdrom
;   public = yes

# The next two parameters show how to auto-mount a CD-ROM when the
#    cdrom share is accesed. For this to work /etc/fstab must contain
#    an entry like this:
#
#       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
#    is mounted on /cdrom
#
;   preexec = /bin/mount /cdrom
;   postexec = /bin/umount /cdrom

#22 Le 12/05/2007, à 15:04

figaro

Re : [samba + LDAP] Ajouter domaine sur client windows

OK . Pourquoi commentes-tu cette ligne

;   name resolve order = lmhosts host wins bcast


PS: pas mal de "salades" dans le smb.conf...... tu devrais essayer de repartir à zéro.

Dernière modification par figaro (Le 12/05/2007, à 15:09)


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#23 Le 12/05/2007, à 15:38

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

figaro a écrit :

OK . Pourquoi commentes-tu cette ligne

;   name resolve order = lmhosts host wins bcast

heuuu...

PS: pas mal de "salades" dans le smb.conf...... tu devrais essayer de repartir à zéro.

Ouais, j'ai pioché dans pas mal de tuto différents, et je connais pas grand chose à tout ça, donc forcemment ça donne des mélanges désordonnés :-/

#24 Le 12/05/2007, à 16:12

figaro

Re : [samba + LDAP] Ajouter domaine sur client windows

Comme ce que tu veux faire est assez complexe, tu devrais t'offrir un bon bouquin sur Samba.

Je ne peux t'aider plus car LDPA je n'utilise pas. Si tu cherches simplement à avoir un petit réseau familial je t'envoie vers mon tuto (il y a deux posts sur le sujet et un tuto en pdf téléchargeable).
Sinon attends chapi il a l'air de connaître les Domaines avec Samba et Windows.

Bon courage. smile


Le blog de figaro (astuces diverses et tutos Samba pour débutants)
Le blog de cep (astuces Linux avancées)
Debian Lenny 6.0.1, Ubuntu 10.04.2, Ubuntu Remix 9.10, Ubuntu Netbook 10.04

Hors ligne

#25 Le 12/05/2007, à 17:07

naunheim

Re : [samba + LDAP] Ajouter domaine sur client windows

Ok, merci pour ton aide.
Je note l'adresse du tuto, merci bien smile