LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-01-2005, 05:38 AM   #1
nicolasdiogo
Member
 
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 130

Rep: Reputation: 20
LDAP SERVER - CLIENT CONNECTION on suse 9.2 - connection error


hello!

just to make it clear from the start, i would like to say that i have done my research and even bought a book on the subject trying to learn the solution by myself, but as you can see i have not managed to solve the problem.

i have installed a suse 9.2 on a siemens laptop (amilod D) which works great! wireless and all. but i have not yet managed to use its LDAP server and ,worse stills, its client authetication.

i have googled about but without success!
tried this one for instance;
http: // wiki.osuosl.org/display/LNX/LDAP+SSL+and+SUSE

i have then bought the suse linux 9 - bible collection and also followed its advices without success.

I am almost certain that i am missing something really stupid BUT i just cannot find it.

synopsis of problem;

the LDAP SERVER is configured with

base "o=adme,c=uk"
rootdn "cn=admin,o=adme,c=uk"
rootpw "secret"


the LDAP CLIENT is configured with:

host "127.0.0.1" # the LDAP SERVER is in the same machine as the client
base "o=adme,c=uk"
bindpw "secret"

when using YAST-LDAP-CLIENT it gives an error mesage stating that 'CONNECTION TO LDAP SERVER CANNOT BE ESTABLISHED: CONNECT ERROR"


however, from the command line if i issue a ldapsearch -x i receive a successful response.

additionally, i can issue "getent passwd" and "getent group" commands successfully.


i have added the configuratiion files below,

I WELCOME YOUR INPUT INTO THIS MATTER.

many thanks in advance,


Nicolas Diogo




i have configured the LDAP SERVER as per etc/openldap/slapd.conf below:

####################start###########################
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/rfc2307bis.schema
include /etc/openldap/schema/yast.schema

# Define global ACLs to disable default read access.

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org

pidfile /var/run/slapd/slapd.pid
argsfile /var/run/slapd/slapd.args

# Load dynamic backend modules:
modulepath /usr/lib/openldap/modules
moduleload back_ldap.la
moduleload back_meta.la
moduleload back_monitor.la
moduleload back_perl.la

# Sample security restrictions
# Require integrity protection (prevent hijacking)
# Require 112-bit (3DES or better) encryption for updates
# Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64

# Sample access control policy:
# Root DSE: allow anyone to read it
# Subschema (sub)entry DSE: allow anyone to read it
# Other DSEs:
# Allow self write access to user password
# Allow anonymous users to authenticate
# Allow read access to everything else
# Directives needed to implement policy:
access to dn.base=""
by * read

access to dn.base="cn=Subschema"
by * read

access to attr=userPassword,userPKCS12
by self write
by * auth

access to attr=shadowLastChange
by self write
by * read

access to *
by * read

# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn. (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!

#######################################################################
# BDB database definitions
#######################################################################

database bdb
checkpoint 1024 5
cachesize 10000
suffix "o=acme,c=uk"
rootdn "cn=admin,o=acme,c=uk"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /var/lib/ldap
# Indices to maintain
index objectClass eq


#####################end###########################

and etc/openldap/ldap.conf as:

#####################start##########################

#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.


BASE o=acme,c=uk

#URI ldap://ldap.example.com ldap://ldap-master.example.com:666

#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never

TLS_REQCERT allow

#####################end##########################

YAST-LDAP-client uses the following files for connecting to the LDAP SERVER:

etc/ldap.conf

######################start########################

#
# This is the configuration file for the LDAP nameservice
# switch library, the LDAP PAM module and the shadow package.
#

# Your LDAP server. Must be resolvable without using LDAP.
host 127.0.0.1

# The distinguished name of the search base.
base o=acme,c=uk

# The LDAP version to use (defaults to 3
# if supported by client library)
# ldap_version 3
ldap_version 3

# The distinguished name to bind to the server with.
# Optional: default is to bind anonymously.
# binddn cn=admin,o=acme,c=uk

# The credentials to bind with.
# Optional: default is no credential.
bindpw secret

# The distinguished name to bind to the server with
# if the effective user ID is root. Password is
# stored in /etc/ldap.secret (mode 600)
# rootbinddn cn=admin,o=acme,c=uk

# The port.
# Optional: default is 389.
#port 389

# The search scope.
#scope sub
#scope one
#scope base

# Search timelimit
#timelimit 30

# Bind timelimit
bind_timelimit 30

# Idle timelimit; client will close connections
# (nss_ldap only) if the server has not been contacted
# for the number of seconds specified below.
idle_timelimit 3600

# Filter to AND with uid=%s
#pam_filter objectclass=account

# The user ID attribute (defaults to uid)
#pam_login_attribute uid

# Search the root DSE for the password policy (works
# with Netscape Directory Server)
#pam_lookup_policy yes

# Check the 'host' attribute for access control
# Default is no; if set to yes, and user has no
# value for the host attribute, and pam_ldap is
# configured for account management (authorization)
# then the user will not be allowed to login.
#pam_check_host_attr yes

# Group to enforce membership of
#pam_groupdn cn=PAM,ou=Groups,dc=padl,dc=com

# Group member attribute
pam_member_attribute uniquemember

# Specify a minium or maximum UID number allowed
#pam_min_uid 0
#pam_max_uid 0

# Template login attribute, default template user
# (can be overriden by value of former attribute
# in user's entry)
#pam_login_attribute userPrincipalName
#pam_template_login_attribute uid
#pam_template_login nobody

# Do not hash the password at all; presume
# the directory server will do it, if
# necessary. This is the default.
#pam_password clear

# Hash password locally; required for University of
# Michigan LDAP server, and works with Netscape
# Directory Server if you're using the UNIX-Crypt
# hash mechanism and not using the NT Synchronization
# service.
pam_password crypt

# Remove old password first, then update in
# cleartext. Necessary for use with Novell
# Directory Services (NDS)
#pam_password nds

# Update Active Directory password, by
# creating Unicode password and updating
# unicodePwd attribute.
#pam_password ad

# Use the OpenLDAP password change
# extended operation to update the password.
#pam_password exop

# Redirect users to a URL or somesuch on password
# changes.
#pam_password_prohibit_message Please visit internal to change your password.

# RFC2307bis naming contexts
# Syntax:
# nss_base_XXX base?scope?filter
# where scope is {base,one,sub}
# and filter is a filter to be &'d with the
# default filter.
# You can omit the suffix eg:
# nss_base_passwd ou=People,
# to append the default base DN but this
# may incur a small performance impact.
#nss_base_passwd ou=People,dc=padl,dc=com?one
#nss_base_shadow ou=People,dc=padl,dc=com?one
#nss_base_group ou=Group,dc=padl,dc=com?one
#nss_base_hosts ou=Hosts,dc=padl,dc=com?one
#nss_base_services ou=Services,dc=padl,dc=com?one
#nss_base_networks ou=Networks,dc=padl,dc=com?one
#nss_base_protocols ou=Protocols,dc=padl,dc=com?one
#nss_base_rpc ou=Rpc,dc=padl,dc=com?one
#nss_base_ethers ou=Ethers,dc=padl,dc=com?one
#nss_base_netmasks ou=Networks,dc=padl,dc=com?ne
#nss_base_bootparams ou=Ethers,dc=padl,dc=com?one
#nss_base_aliases ou=Aliases,dc=padl,dc=com?one
#nss_base_netgroup ou=Netgroup,dc=padl,dc=com?one

# attribute/objectclass mapping
# Syntax:
#nss_map_attribute rfc2307attribute mapped_attribute
#nss_map_objectclass rfc2307objectclass mapped_objectclass

# configure --enable-nds is no longer supported.
# For NDS now do:
#nss_map_attribute uniqueMember member

# configure --enable-mssfu-schema is no longer supported.
# For MSSFU now do:
#nss_map_objectclass posixAccount User
#nss_map_attribute uid msSFUName
#nss_map_attribute uniqueMember posixMember
#nss_map_attribute userPassword msSFUPassword
#nss_map_attribute homeDirectory msSFUHomeDirectory
#nss_map_objectclass posixGroup Group
#pam_login_attribute msSFUName
#pam_filter objectclass=User
#pam_password ad

# configure --enable-authpassword is no longer supported
# For authPassword support, now do:
#nss_map_attribute userPassword authPassword
#pam_password nds

# For IBM SecureWay support, do:
#nss_map_objectclass posixAccount aixAccount
#nss_map_attribute uid userName
#nss_map_attribute gidNumber gid
#nss_map_attribute uidNumber uid
#nss_map_attribute userPassword passwordChar
#nss_map_objectclass posixGroup aixAccessGroup
#nss_map_attribute cn groupName
#nss_map_attribute uniqueMember member
#pam_login_attribute userName
#pam_filter objectclass=aixAccount
#pam_password clear

# Netscape SDK LDAPS
#ssl on

# Netscape SDK SSL options
#sslpath /etc/ssl/certs/cert7.db

# OpenLDAP SSL mechanism
# start_tls mechanism uses the normal LDAP port, LDAPS typically 636

ssl start_tls

nss_map_attribute uniqueMember member

pam_filter objectclass=posixAccount

nss_base_passwd o=acme,c=uk
nss_base_shadow o=acme,c=uk
nss_base_group o=acme,c=uk
#ssl on

# OpenLDAP SSL options
# Require and verify server certificate (yes/no)
# Default is "no"
#tls_checkpeer yes

# CA certificates for server certificate verification
# At least one of these are required if tls_checkpeer is "yes"
#tls_cacertfile /etc/ssl/ca.cert
#tls_cacertdir /etc/ssl/certs

# SSL cipher suite
# See man ciphers for syntax
#tls_ciphers TLSv1

# Client certificate and key
# Use these, if your server requires client authentication.
#tls_cert
#tls_key

######################end#########################

etc/nsswitch.conf:

######################start########################

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# compat Use compatibility setup
# nisplus Use NIS+ (NIS version 3)
# nis Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# db Use the /var/db databases
# [NOTFOUND=return] Stop searching if not found so far
#
# For more information, please read the nsswitch.conf.5 manual page.
#

# passwd: files nis
# shadow: files nis
# group: files nis

passwd: compat
group: compat

hosts: files lwres dns
networks: files dns

services: files
protocols: files

rpc: files
ethers: files

netmasks: files
netgroup: files
publickey: files

bootparams: files
automount: files nis ldap
aliases: files

passwd_compat: ldap
group_compat: ldap

######################end#########################


etc/security/pam_unix2.conf:

#####################start##########################

# pam_unix2 config file
#
# This file contains options for the pam_unix2.so module.
# It contains a list of options for every type of management group,
# which will be used for authentication, account management and
# password management. Not all options will be used from all types of
# management groups.
#
# At first, pam_unix2 will read this file and then uses the local
# options. Not all options can be set her global.
#
# Allowed options are:
#
# debug (account, auth, password, session)
# nullok (auth)
# md5 (password / overwrites /etc/default/passwd)
# bigcrypt (password / overwrites /etc/default/passwd)
# blowfish (password / overwrites /etc/default/passwd)
# crypt_rounds=XX
# none (session)
# trace (session)
# call_modules=x,y,z (account, auth, password)
#
# Example:
# auth: nullok
# account:
# password: nullok blowfish crypt_rounds=8
# session: none
#

auth: use_ldap nullok
account: use_ldap
password: use_ldap nullok
session: none

#####################end####[B]#####################
 
Old 03-01-2005, 08:00 AM   #2
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
There are some things you need to know about LDAP. Firstly all comands loke ldapsearch, ldapadd etc etc use the config file /etc/openldap/ldap.conf. For PAM or any other system auth (like linux login) - it uses /etc/ldap.conf.

So your ldapsearch command is using /etc/openldap/ldap.conf.

The other thing is you have enabled starttls. You would need to generate certs for that and the host you're contacting should match the name on the cert. It is easier to leave this option out as the host you're contacting is localhost. Comment all the tls stuff out and see if it works. I can mail you my config but I'm not in front of my machine right now.

You've granted

access to *
by * read

which is correct as the client needs access to auth information. Then you shouldn't need to use bindpw in your ldap.conf. If you specify a bindpw then you should specify binddn as well.


HTH
 
Old 03-01-2005, 10:10 AM   #3
nicolasdiogo
Member
 
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 130

Original Poster
Rep: Reputation: 20
thanks a lot linuxxed!

i can happily confirm that i have connected!!!

since you have explained it so clear that YAST-client uses the etc/ldap.conf to connect to the server and that TLS enabled was not such a good idea. I have simply deleted the file and run YAST-LDAP-CLIENT which then recreated the files and i have unticked the LDAP TLS/SSL box on the GUI.


however, there is another question that i would like your input.

when i connect to the server there is a message that says:

NO ENTRY WITH DN 'o=acme,c=uk' EXISTS ON THE LDAP SERVER.
CREATE IT NOW?

if i try to create the object it then says that: object can not be created

and i don't then i have the option of create objects manually.

could you please provide some guidance?

thanks

Nicolas
 
Old 03-01-2005, 11:42 AM   #4
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
TLS is a godsend when you're connecting between different hosts as it encrypts all data. But if you are connecting to localhost then it makes little sense.

If you want to use TLS then in the client file

TLS_CACERT /etc/certs/ldap.pem
(Same pem file as on server)

On the server you should have the following lines enabled
TLSCertificateFile /etc/certs/slapd.pem
TLSCertificateKeyFile /etc/certs/slapd.pem
TLSCACertificateFile /etc/certs/slapd.pem
TLSCipherSuite HIGH:MEDIUM:+SSLv2

You can use openssl to generate pem file. make sure the common name matches the host you are contacting.


-----------

That is because you are connecting as a under privileged user. Root DN will have super access.
rootdn "cn=admin,o=adme,c=uk"
rootpw "secret"
(in your case) - you can set binddn and bindpw - make sure you disable access to normal users to this ldap.conf

Have you added data to your ldap server? You need to create a structure if you want unix accounts stored on LDAP. Yu can create a data file and then use ldapadd command to manually add data.
ldapadd -x -f FILENAME -w [BINDPWD] -D "cn=admin,o=adme,c=uk"

You can also use the GUI gq if you install on your machine to view LDAP data.

Here's an excellent link.

http://www.samag.com/documents/s=914...405a/0405a.htm

HTH
 
Old 03-01-2005, 01:43 PM   #5
nicolasdiogo
Member
 
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 130

Original Poster
Rep: Reputation: 20
Many thanks

thanks for taking the time to reply to my post!!

i will be checking out your quote to improve my knowledge on LDAP.


regards,

Nicolas
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Client/Server connection problem James_dean Programming 7 09-28-2005 08:31 PM
LDAP SERVER Client Connection on SUSE 9.2 - connection error jcarton Linux - Networking 3 03-19-2005 12:40 PM
LDAP SERVER - CLIENT CONNECTION on suse 9.2 - connection error nicolasdiogo SUSE / openSUSE 0 03-01-2005 05:43 AM
DHCP Server Client no connection to Internet westverg Linux - Networking 3 02-28-2005 07:08 AM
Showing CLIENT<-server->INTERNET connection from server. druuna Linux - Networking 2 05-03-2004 01:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration