Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-14-2008, 03:26 PM
|
#1
|
Member
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Rep:
|
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.
|
|
|
11-14-2008, 03:32 PM
|
#2
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
I don't know the answer wrt configuration, but you could always block it with iptables.
|
|
|
11-14-2008, 03:38 PM
|
#3
|
Member
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Original Poster
Rep:
|
Quote:
Originally Posted by billymayday
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.
|
|
|
11-14-2008, 04:57 PM
|
#4
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
|
From slapd man page, I think that you can try something like:
Code:
slapd -h ldap://127.0.0.1/ ldaps:///
|
|
|
11-14-2008, 05:09 PM
|
#5
|
Member
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
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?
|
|
|
11-14-2008, 05:25 PM
|
#6
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,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.
|
|
|
11-14-2008, 05:43 PM
|
#7
|
Member
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
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?
|
|
|
11-14-2008, 06:02 PM
|
#8
|
Member
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Original Poster
Rep:
|
Quote:
Originally Posted by ciphyre
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?
|
|
|
11-15-2008, 04:09 AM
|
#9
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,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.
|
|
|
11-16-2008, 12:43 AM
|
#10
|
Member
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
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
|
|
|
11-16-2008, 02:49 PM
|
#11
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,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.
|
|
|
11-17-2008, 01:06 AM
|
#12
|
LQ Newbie
Registered: Jul 2007
Posts: 7
Rep:
|
ldap config
Quote:
Originally Posted by ciphyre
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
|
|
|
11-17-2008, 01:18 AM
|
#13
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
|
|
|
11-17-2008, 12:46 PM
|
#14
|
Member
Registered: Aug 2008
Distribution: FEDORA, RHEL, SLES
Posts: 51
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
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!!
|
|
|
11-19-2008, 02:36 AM
|
#15
|
LQ Newbie
Registered: Jul 2007
Posts: 7
Rep:
|
thanx
Thanks... I am trying....
|
|
|
All times are GMT -5. The time now is 08:07 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|