Difference between revisions of "Set up an ldap server"

From Linuxintro
imported>ThorstenStaerk
imported>WikiSysop
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
= For SUSE =
 
= For SUSE =
 +
 +
== install the config module ==
 +
Install the configuration module for yast2 to set up an ldap server:
 +
yast -i yast2-ldap-server
 +
Start the configuration:
 +
yast2 ldap-server
 +
When asked for installing openldap, answer "Install".
  
 
== install ldap server ==
 
== install ldap server ==
Just follow http://en.opensuse.org/Howto_LDAP_server
+
Choose "Start ldap server" -> yes, tag "open port in firewall" and choose "Configure...". Choose "Add database". As Base DN, use dc=example,dc=com. Finish yast2.
  
 
== test ldap server ==
 
== test ldap server ==
  
=== initialize ldap server ===
+
=== Restart ldap server ===
See http://ubuntuforums.org/showthread.php?p=1582401
+
Restarting ldap server must be possible:
 +
/etc/init.d/ldap stop
 +
/etc/init.d/ldap start
 +
Now the command
 +
/etc/init.d/ldap status
 +
Should show <code>running</code>. The port must be reachable via network:
 +
nmap localhost
 +
Should show one line
 +
389/tcp  open  ldap
 +
 
 +
=== Adding an OU ===
 +
To add an organizational unit, do
 +
cat >orgunit<<EOF
 +
dn: ou=orgunit1,dc=example,dc=com
 +
objectClass: top
 +
objectClass: organizationalUnit
 +
ou: orgunit1
 +
description: Test orgUnit
 +
EOF
 +
slapadd -v -l orgunit
 +
 
 +
=== Adding a person ===
 +
cat >person<<EOF
 +
dn: cn=John Johnson,ou=orgunit1,dc=example,dc=com
 +
objectclass: top
 +
objectclass: person
 +
objectclass: organizationalPerson
 +
sn: John
 +
cn: John Johnson
 +
EOF
 +
slapadd -v -l person
  
=== add an entry ===
+
=== Using an application ===
See http://ubuntuforums.org/showthread.php?p=1582401
+
You can now test your ldap server using e.g. kaddressbook.
  
=== query ldap server ===
+
= See also =
To prove your ldap server works, let it show all users that you have added:
+
* http://en.opensuse.org/Howto_LDAP_server
slapcat
+
* http://ubuntuforums.org/showthread.php?p=1582401

Latest revision as of 20:02, 1 September 2008

For SUSE

install the config module

Install the configuration module for yast2 to set up an ldap server:

yast -i yast2-ldap-server

Start the configuration:

yast2 ldap-server

When asked for installing openldap, answer "Install".

install ldap server

Choose "Start ldap server" -> yes, tag "open port in firewall" and choose "Configure...". Choose "Add database". As Base DN, use dc=example,dc=com. Finish yast2.

test ldap server

Restart ldap server

Restarting ldap server must be possible:

/etc/init.d/ldap stop
/etc/init.d/ldap start

Now the command

/etc/init.d/ldap status

Should show running. The port must be reachable via network:

nmap localhost

Should show one line

389/tcp  open  ldap

Adding an OU

To add an organizational unit, do

cat >orgunit<<EOF
dn: ou=orgunit1,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: orgunit1
description: Test orgUnit
EOF
slapadd -v -l orgunit

Adding a person

cat >person<<EOF
dn: cn=John Johnson,ou=orgunit1,dc=example,dc=com
objectclass: top
objectclass: person
objectclass: organizationalPerson
sn: John
cn: John Johnson
EOF
slapadd -v -l person

Using an application

You can now test your ldap server using e.g. kaddressbook.

See also