LDAP事例 ldapuser
Table of Contents
example.com -> People -> ldapuser の作成
ディレクトリを作成
/opt/home/ldapuser を作成する
example.com を作成
example_com.ldif を作成
dn: dc=example,dc=com objectClass: dcObject objectClass: organization dc: example o: example
ldapadd する
root@DD-WRT:/opt/home/ldapuser# ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f example_com.ldif adding new entry "dc=example,dc=com"
Root DSE 以下に o(Organization) : example が作成された
People を作成
People.ldif を作成
dn: ou=People,dc=example,dc=com objectClass: organizationalUnit ou: People
ldapadd する
root@DD-WRT:/opt/home/ldapuser# ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f People.ldif adding new entry "ou=People,dc=example,dc=com"
o(Organization) : example の下に、ou(Organization Unit) : People が作成された
ldapuser を作成
ldapuser.ldif を作成
userPassword に記載する文字列(Hash)は slappasswd コマンドで生成する。
root@DD-WRT:/opt/home/ldapuser# slappasswd -s ldapuser
{SSHA}FuTMpjLEYQhnyH3f6/xPzC/HywVqz/I5
dn: uid=ldapuser,ou=People,dc=example,dc=com
objectClass: account
objectClass: posixAccount
uid: ldapuser
cn: ldapuser
userPassword: {SSHA}FuTMpjLEYQhnyH3f6/xPzC/HywVqz/I5
loginShell: /bin/bash
uidNumber: 1000
gidNumber: 1000
homeDirectory: /opt/home/ldapuser
ldapadd する
root@DD-WRT:/opt/home/ldapuser# ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f ldapuser.ldif adding new entry "uid=ldapuser,ou=People,dc=example,dc=com"
ou(Organization Unit) : People の下に、uid : ldapuser が作成された