LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-14-2008, 03:26 PM   #1
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51

Rep: Reputation: 15
LDAP server configuration on RHEL5


I implemented SSL/TLS support for my ldap server but I need to prevent slapd from listening on port 389 for unencrypted requests.

Does anyone know how to force slapd to only listen to port 389 on the local loopback address on RHEL5?

The init.d script references the file ldap under /etc/sysconfig so I tried adding the options to /etc/sysconfig/ldap but it still listens on all addresses.

Thanks.
 
Old 11-14-2008, 03:32 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I don't know the answer wrt configuration, but you could always block it with iptables.
 
Old 11-14-2008, 03:38 PM   #3
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by billymayday View Post
I don't know the answer wrt configuration, but you could always block it with iptables.
Ya that is part of my overall plan, but I am just concerned with the relying on just iptables or even tcp wrappers or xinetd.

The environment I am using ldap in has to be extremely paranoid because the servers are accessible via the Internet.
 
Old 11-14-2008, 04:57 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
From slapd man page, I think that you can try something like:
Code:
slapd -h ldap://127.0.0.1/ ldaps:///
 
Old 11-14-2008, 05:09 PM   #5
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
From slapd man page, I think that you can try something like:
Code:
slapd -h ldap://127.0.0.1/ ldaps:///
I tried using this but the only port ldap was listening to was 389, nothing on 636.

Does the /etc/ldap.conf file control any slapd configuration or is that just for ldap client options?
 
Old 11-14-2008, 05:25 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Maybe it needs the double quotes:
Code:
slapd -h "ldap://127.0.0.1/ ldaps:///"
Quote:
Does the /etc/ldap.conf file control any slapd configuration or is that just for ldap client options?
Of course it controls various setup aspects of the slapd daemon, but nothing regarding the networking part (like listening ports and such). But you need to put in slapd.conf the TLS options for the server to use ldaps.
 
Old 11-14-2008, 05:43 PM   #7
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Maybe it needs the double quotes:
Code:
slapd -h "ldap://127.0.0.1/ ldaps:///"
Of course it controls various setup aspects of the slapd daemon, but nothing regarding the networking part (like listening ports and such). But you need to put in slapd.conf the TLS options for the server to use ldaps.
The TLS options are configured and working.

I should add that I have been using the redhat "service ldap start" (and also /etc/init.d/ldap)feature to get slapd to start. I took a look at the /var/run/openldap/slapd.args file to see how it is being started using these features and found this:

/usr/sbin/slapd -h ldap:/// ldaps:/// -u ldap

So I stopped slapd and manually ran it as so:

/usr/sbin/slapd -h ldaps:/// -u ldap

Which worked. So.....looks like I have to edit the init script for ldap to turn off using port 389 so that a reboot doesn't open up this hole.

Anyone good at editing init scripts?
 
Old 11-14-2008, 06:02 PM   #8
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ciphyre View Post
The TLS options are configured and working.

I should add that I have been using the redhat "service ldap start" (and also /etc/init.d/ldap)feature to get slapd to start. I took a look at the /var/run/openldap/slapd.args file to see how it is being started using these features and found this:

/usr/sbin/slapd -h ldap:/// ldaps:/// -u ldap

So I stopped slapd and manually ran it as so:

/usr/sbin/slapd -h ldaps:/// -u ldap

Which worked. So.....looks like I have to edit the init script for ldap to turn off using port 389 so that a reboot doesn't open up this hole.

Anyone good at editing init scripts?

The ldap init script references /etc/sysconfig/ldap, so i shouldn't have to modify the script directly however the options I added are not getting picked up, any reason why?
 
Old 11-15-2008, 04:09 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Quote:
The ldap init script references /etc/sysconfig/ldap, so i shouldn't have to modify the script directly however the options I added are not getting picked up, any reason why?
I don't have a redhat system handy at the moment, so could you post the contents of /etc/sysconfig/ldap.
 
Old 11-16-2008, 12:43 AM   #10
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
I don't have a redhat system handy at the moment, so could you post the contents of /etc/sysconfig/ldap.
Here is what I have:

# File: /etc/sysconfig/ldap
#
# Run slapd with -h "... ldap:/// ..."
# yes/no, default: yes
SLAPD_LDAP=no
#
# Run slapd with -h "... ldapi:/// ..."
# yes/no, default: no
SLAPD_LDAPI=no
#
# Run slapd with -h "... ldaps:/// ..."
# yes/no, default: no
SLAPD_LDAPS=yes
 
Old 11-16-2008, 02:49 PM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
You can set every option to "no" in /etc/sysconfig/ldap and add the working -h "ldap://127.0.0.1/ ldaps:///" option in the slapd startup script /etc/init.d/slapd.
 
Old 11-17-2008, 01:06 AM   #12
santanu.roy
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
ldap config

Quote:
Originally Posted by ciphyre View Post
I implemented SSL/TLS support for my ldap server but I need to prevent slapd from listening on port 389 for unencrypted requests.

Does anyone know how to force slapd to only listen to port 389 on the local loopback address on RHEL5?

The init.d script references the file ldap under /etc/sysconfig so I tried adding the options to /etc/sysconfig/ldap but it still listens on all addresses.

Thanks.


can you please guide me to configure a ldap server which will be using instead of nis.

thanks.
santanu
 
Old 11-17-2008, 01:18 AM   #13
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Try the howto at www.linuxhomenetworking.com
 
Old 11-17-2008, 12:46 PM   #14
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
You can set every option to "no" in /etc/sysconfig/ldap and add the working -h "ldap://127.0.0.1/ ldaps:///" option in the slapd startup script /etc/init.d/slapd.
Thanks for the info, I took your suggestion of modifying the init script and the /etc/sysconfig/ldap options and modified it a little. I looked for the variable for ldap:/// within the script and simply modified it so it looked like this: "ldap://127.0.0.1", and restarted slapd. Worked like a charm!!!!

Thanks again!!
 
Old 11-19-2008, 02:36 AM   #15
santanu.roy
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
thanx

Thanks... I am trying....
 
  


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
Ldap server configuration tarunlinux Linux - Server 3 09-19-2008 06:11 AM
Installation of RHEL5 (Server and client configuration) shanthakumarks Linux - Newbie 7 06-15-2008 02:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:07 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