LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Thread Tools
Old 11-14-2008, 04:26 PM   #1
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Thanked: 0
LDAP server configuration on RHEL5


[Log in to get rid of this advertisement]
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.
ciphyre is offline     Reply With Quote
Old 11-14-2008, 04:32 PM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Thanked: 126
I don't know the answer wrt configuration, but you could always block it with iptables.
billymayday is offline     Reply With Quote
Old 11-14-2008, 04:38 PM   #3
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Thanked: 0

Original Poster
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.
ciphyre is offline     Reply With Quote
Old 11-14-2008, 05:57 PM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,040
Thanked: 222
From slapd man page, I think that you can try something like:
Code:
slapd -h ldap://127.0.0.1/ ldaps:///
bathory is offline     Reply With Quote
Old 11-14-2008, 06:09 PM   #5
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Thanked: 0

Original Poster
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?
ciphyre is offline     Reply With Quote
Old 11-14-2008, 06:25 PM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,040
Thanked: 222
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.
bathory is offline     Reply With Quote
Old 11-14-2008, 06:43 PM   #7
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Thanked: 0

Original Poster
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?
ciphyre is offline     Reply With Quote
Old 11-14-2008, 07:02 PM   #8
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Thanked: 0

Original Poster
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?
ciphyre is offline     Reply With Quote
Old 11-15-2008, 05:09 AM   #9
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,040
Thanked: 222
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.
bathory is offline     Reply With Quote
Old 11-16-2008, 01:43 AM   #10
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Thanked: 0

Original Poster
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
ciphyre is offline     Reply With Quote
Old 11-16-2008, 03:49 PM   #11
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,040
Thanked: 222
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.
bathory is offline     Reply With Quote
Old 11-17-2008, 02:06 AM   #12
santanu.roy
LQ Newbie
 
Registered: Jul 2007
Posts: 7
Thanked: 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
santanu.roy is offline     Reply With Quote
Old 11-17-2008, 02:18 AM   #13
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Thanked: 126
Try the howto at www.linuxhomenetworking.com
billymayday is offline     Reply With Quote
Old 11-17-2008, 01:46 PM   #14
ciphyre
Member
 
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Thanked: 0

Original Poster
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!!
ciphyre is offline     Reply With Quote
Old 11-19-2008, 03:36 AM   #15
santanu.roy
LQ Newbie
 
Registered: Jul 2007
Posts: 7
Thanked: 0
thanx

Thanks... I am trying....
santanu.roy is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 07:11 AM
Installation of RHEL5 (Server and client configuration) shanthakumarks Linux - Newbie 7 06-15-2008 03:50 PM


All times are GMT -5. The time now is 09:39 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration