Synology usage series 9 – Setup OpenLDAP


Addition: Nov 07 2011

Adding Samba Attributes

Here is the steps to add samba attributes:

  1. SSH/Telnet to Diskstation
  2. Download samba 3.x source package using wget

    # cd /opt/tmp
    # wget http://www.samba.org/samba/ftp/samba-latest.tar.gz

  3. Unpack the source package

    # cd /opt/tmp
    # tar xvzf samba-latest.tar.gz

  4. Copy the samba.schema to openldap directory

    # cp /opt/tmp/samba-[version]/examples/LDAP/samba.schema /opt/etc/openldap/schema

  5. Edit slapd.conf and adding the samba schema

    # vi /opt/etc/openldap/slapd.conf

    Add following lines to slapd.conf

    include /opt/etc/openldap/schema/samba.schema

    Save the file.

  6. Restart openldap

    # /opt/etc/init.d/S58slapd stop
    # /opt/etc/init.d/S58slapd start

  7. Edit your ldif file and add your samba attributes

    For example:

    objectClass: …
    objectClass: …
    objectClass: sambaSamAccount


    sambaLMPassword: xxxxxxxxxxxxxxxxx
    sambaNTPassword: xxxxxxxxxxxxxxxxx
    samba…: …..

    And then import your ldif file.

Generate SambaNTPassword and SambaLMPassword

mkntpwd is needed to generate NT and LM Password.


# cd /opt/tmp
# wget http://nchc.dl.sourceforge.net/sourceforge/ldaputils/mkntpwd.tar.gz
# tar xvzf mkntpwd.tar.gz
# cd mkntpwd
# make
# ./mkntpwd -N [your password]
# ./mkntpwd -L [your password]




6 thoughts


  1. Hi
    Your tutorial is perfect
    i have ds110j and i’ve done everything and it works but i can’t put ldif file to LDAP

    I get
    ldap_bind: Invalid credentials (49)

    I have checked everything but i’m something missing.

    Please can You help ??

    Thankyou

  2. Please can You help me – if it is necessary i can set up my synology on external ip so that You could see it 🙂 Thank You for Your help

    • LDAP schema is a pain to learn.

      I’m not familar with LDAP schema. I’m afraid I don’t have enough skill to debug your LDIF.

      I’m also new to LDAP things. It took me couple days to write the LDIF sample in page 2 -_-;

      By the way, make sure you are binding as ldap administrator when running ldapadd (make sure the password is correct)

      Good Luck!

  3. How can i check it if the password is ok. i used slappasswd and got a password in ssh hash and i have put it in slapd.conf

    What else can i check ??

Leave a Reply

Your email address will not be published. Required fields are marked *