Bug#411042: [Pkg-samba-maint] Bug#411042: samba -dosen't connect to OpenLDAP

Mgr. Peter Tuharsky tuharsky at misbb.sk
Mon Feb 19 07:31:25 CET 2007


Steve Langasek  wrote / napísal(a):
> On Thu, Feb 15, 2007 at 01:36:51PM +0100, Mgr. Peter Tuharsky wrote:
>> We've had a working Samba/LDAP domain based on Sarge. Now we're trying 
>> to move to Etch. We recycled old configs, or modified the new ones to be 
>> equal.
> 
>> Now, when I start Samba, it seems it cannot connect the LDAP server. 
>> I've got these errors in log:
> 
>> lib/smbldap.c:smb_ldap_start_tls(612)
>>   Failed to issue the StartTLS instruction: Connect error
>> lib/smbldap.c:another_ldap_try(1150)
>>   Connection to LDAP server failed for the 1 try!
> 
>> Soon, the smbd exits.
> 
> Could you please post your smb.conf?
> 

Of course. Here You are.

Peter
-------------- next part --------------
#
# 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 = ldap1.sk
   
# 070208: odstavec podla stareho
# netbios name is the name you will see in "Network Neighbourhood",
# but defaults to your hostname

# 070213: vyhodime prec
;  netbios name = ldap1
  
# server string is the equivalent of the NT Description field
# 070208: podla stareho
#   server string = %h server (Samba %v)

   server string = Server %L

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

# 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

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
# This will prevent nmbd to search for NetBIOS names through DNS.
# 070212 -v starom bolo yes, davam no

    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

# 070212: Spustime casove sluzby

    time server = yes
    
# 070212: Prevzaty odstavec zo stareho
# 060418: podla manualu zapnute volby preserve case = yes, short preserve case = yes,
# case sensitive = no
;  preserve case = no
;  short preserve case = no

    short preserve case = yes
    preserve case = yes
    
# 060418
# Default case is normally upper case for all DOS files
;  default case = lower
# Be very careful with case sensitivity - it can break things!
;  case sensitive = no
    
    case sensitive = no

# Prevzaty odstavec zo stareho:
# Enabling internationalization:
# you can match a Windows code page with a UNIX character set.
# Windows: 437 (US), 737 (GREEK), 850 (Latin1 - Western European),
# 852 (Eastern Eu.), 861 (Icelandic), 932 (Cyrillic - Russian),
# 936 (Japanese - Shift-JIS), 936 (Simpl. Chinese), 949 (Korean Hangul),
# 950 (Trad. Chin.).
# UNIX: ISO8859-1 (Western European), ISO8859-2 (Eastern Eu.),
# ISO8859-5 (Russian Cyrillic), KOI8-R (Alt-Russ. Cyril.)
# This is an example for french users:

    dos charset = 852
    unix charset = ISO8859-2
      

#### 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 = 10000

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

    syslog only = no

# 070208: odstavec podla stareho:
# Set the log (verbosity) level (0 <= log level <= 10)

    log level = 3
 

# 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 = user
# 070208:

    security = user

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

    encrypt passwords = true

# 070212: orevzaty odstavec ohladom passdb backend zo stareho
# Samba Password Database configuration:
# Samba now has runtime-configurable password database backends. Multiple
# passdb backends may be used, but users will only be added to the first one
# Default:
; passdb backend = smbpasswd guest
# TDB backen with fallback to smbpasswd and guest
; passdb backend = tdbsam smbpasswd guest
# LDAP with fallback to smbpasswd guest
# Enable SSL by using an ldaps url, or enable tls with 'ldap ssl' below.
# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.  
# 070208:
#   passdb backend = tdbsam

    passdb backend = ldapsam:"ldap://vedko6.misbb.sk:389"

# Use the samba2 LDAP schema:
# passdb backend = ldapsam_compat:ldaps://localhost smbpasswd guest
		 

# 070208: podla stareho
#   obey pam restrictions = yes

    obey pam restrictions = no

;   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
# 070208:

    ldap passwd sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan at informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
# 070208: podla stareho
#   passwd program = /usr/bin/passwd %u
#   passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .

    passwd program = /usr/bin/smbldap-passwd %u
    passwd chat = *Enter\snew\spassword:* %n\n *Retype\snew\spassword:* %n\n *password\supdated\ssuccessfully* .

# 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

# 070208: podla stareho 060411
# 070215: Taky parameter Samba nepozna. Zrejme to treba riesit cez LDAP.
#    min password length = 8
  
########## Domains ###########

# 070208: odstavec prevzaty zo stareho
# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable

;    os level = 255
   
# 070212: odstavec prevzaty zo stareho
# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election

    preferred master = yes
   
# 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
# 070208: podla stareho

    domain logons = yes

# 070215: malo by byt yes
;    domain master = yes

    domain master = 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 = H:
;   logon home = \\%N\%U

### 070208: podla stareho cele odstavce, az po 070208 koniec
# Where to store roaming profiles for WinNT and Win2k
#        %L substitutes for this servers netbios name, %U is username
#        You must uncomment the [Profiles] share below
#   logon path = \\%L\Profiles\%U
# 060418: zakomentovany riadok s prazdnym parametrom a nastaveny logon path

    logon path =

#logon path = \\%L\%U\profile
#logon path = \\%L\Profiles\%U\profile
# 060419: rozhodli sme, ze profily budu na fileserveri datastore
#logon path = \\%L\%U\.profile
# 060510: Takto to ma byt, ale zatial zakomentujeme kvoli problemom s profilmi
#logon path = \\datastore\profiles\%U\.profile

# Where to store roaming profiles for Win9x. Be careful with this as it also
# impacts where Win2k finds it's /HOME share
# logon home = \\%L\%U\.profile
# 060418: zakomentovany riadok s prazdnym parametrom a nastaveny logon home

    logon home =

# 060419: rozhodli sme, ze profily budu na fileserveri datastore
#logon home = \\%L\%U\.profile9x
# 060510: Takto to ma byt, ale zatial zakomentujeme kvoli problemom s profilmi
#logon home = \\datastore\%U\.profile9x
#logon drive = M:

### 070208 koniec


# 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

# 070208: cely odstavec podla stareho:
# run a specific logon batch file per workstation (machine)
#	logon script = %m.bat
# run a specific logon batch file per workstation (machine)
#	logon script = %U.bat
# Nachadza sa v adresari spomenutom v NETLOGON casti

    logon script = LOGIN.BAT



######## LDAP ######## 070212: prevzate komplet zo stareho #########

# 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

#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"
		
# Domain groups:
# Domain groups are now configured by using the 'net groupmap' tool

# username map = /etc/samba/smbusers
 
# Idmap settings:
# Idmap backend to use:
# idmap backend = ldap://ldap2.misbb.sk

# This is a range of unix user-id's that samba will map non-unix RIDs to,
# such as when using Winbind
# idmap uid = 10000-20000
# idmap gid = 10000-20000
		 
    algorithmic rid base =90000

# LDAP configuration for Domain Controlling:
# The account (dn) that samba uses to access the LDAP server
# This account needs to have write access to the LDAP tree
# You will need to give samba the password for this dn, by
# running 'smbpasswd -w mypassword'

    ldap admin dn = cn=manager,dc=misbb,dc=sk

# 070215: Povodne bolo:
#    ldap ssl = start_tls
# Lenze vraj Samba 3.x nepodporuje LDAP over SSL, iba ldap_start_tls
# takze to vraj ma byt bez podtrhovnika start tls:
# a niektori dokonca uvadzaju ldap ssl = off

    ldap ssl = start tls

; ldap server = 127.0.0.1
# start_tls should run on 389, but samba defaults incorrectly to 636
# ldap port = 389

    ldap suffix = dc=misbb,dc=sk

# Seperate suffixes are available for machines, users, groups, and idmap, if
# ldap suffix appears first, it is appended to the specific suffix.
# Example for a unix-ish directory layout:

    ldap machine suffix = ou=Computers
    ldap user suffix = ou=People
    ldap group suffix = ou=Group

# ldap idmap suffix = ou=People
# Example for AD-ish layout:
; ldap machine suffix = cn=Computers
; ldap user suffix = cn=Users
; ldap group suffix = cn=Groups
; ldap idmap suffix = cn=Idmap
		       


########## 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 = @ntadmin
# 070208: podla stareho

    printer admin = @informatika


############ 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
# 070208:
#   socket options = TCP_NODELAY

    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.
# 070208
;   domain master = auto

    domain master = yes

# 070208: odstavec prebraty zo stareho
# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election

    preferred master = yes
   
# 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

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

[homes]

    comment = Home Directories

# 060418: zmena cesty priamo na /home z predtym /var/lib/samba/homes

    path=/home/%u

# 060418: zapnut browsovanie podla manualu

    browseable = yes

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

    writable = yes

# You can enable VFS recycle bin on a per share basis:
# Uncomment the next 2 lines (make sure you create a
# .recycle folder in the base of the share and ensure
# all users will have write access to it. See
# examples/VFS/recycle/REAME in samba-doc for details
;   vfs object = /usr/lib/samba/vfs/recycle.so
# 060418:
	    
    root preexec = PROFILE=/home ; if [ ! -e "$PROFILE" ] ; then mkdir -pm700 "$PROFILE/%u/ .profile"; mkdir -pm700 "$PROFILE/%u/.profile9x" ; chown -R %u.%g "$PROFILE" "$PROFILE/ %u/.profile" "$PROFILE/%u/.profile9x"; fi

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

    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

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
# 070212: Prevzate zo stareho
[netlogon]
    comment = Network Logon Service

#    path = /home/samba/netlogon

    path = /var/lib/samba/netlogon
    guest ok = yes
    writable = no

# 070212: V starom to nie je, zakomentujeme:
#    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
# 071202: Podla stareho
[profiles]
    comment = Users profiles
#    path = /home/samba/profiles
    path = /home
    guest ok = no
#    browseable = no
    browseable = yes
# 070212: V starom nebolo, nechame tak:
    create mask = 0600
    directory mask = 0700

# 070212: Podla stareho
# This script can be enabled to create profile directories on the fly
# You may want to turn off guest acces if you enable this, as it
# hasn't been thoroughly tested.
#root preexec = PROFILE=/home/%u; if [ ! -e "$PROFILE" ]; \
#                then mkdir -pm700 "$PROFILE/profile"; chown %u.%g $PROFILE;fi

    root preexec = PROFILE=/home ; if [ ! -e "$PROFILE" ] ; then mkdir -pm700 "$PROFILE/%u/ .profile"; mkdir -pm700 "$PROFILE/%u/.profile9x" ; chown -R %u.%g "$PROFILE" "$PROFILE/ %u/.profile" "$PROFILE/%u/.profile9x"; fi

# 070212: Tlaciarne zakazeme.
#[printers]
#   comment = All Printers
#   browseable = no
#   path = /var/spool/samba
#   printable = yes
#   public = no
#   writable = no
#   create mode = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
# 070212: Tlaciarne zakazeme.
#[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



More information about the Pkg-samba-maint mailing list