flagflag  If you want to see English page, please click "English" Button at Left.
Page Top

NSL anchor.png

Page Top

CentOS8 (1.4系) anchor.png

Page Top

Information anchor.png

Page Top

Install anchor.png

# dnf install epel-release
# dnf update epel-release
# dnf module install 389-directory-server:stable/default
  • openldap のクライアントも入れておいた方が便利
     
Page Top

Setup anchor.png

# dscreate interactive
  • Create self-signed certificate database に yes で答えると勝手にTLS用の設定をやってくれるみたい.
    • NSSのデータベース用パスワードは /etc/dirsrv/slapd-[Directory server identifier]/pin.txt
  • Create just the top suffix entry [no]: yes
  • DataBase は /var/lib/dirsrv/slapd-[Directory server identifier] にできる.
  • Cockpit からも接続可能
     
Page Top
Example anchor.png
# dscreate interactive
Install Directory Server (interactive mode)
===========================================
selinux is disabled, will not relabel ports or files.
Selinux support will be disabled, continue? [yes]:
Enter system's hostname [altair]: ds.nsl.tuis.ac.jp
Enter the instance name [ds]: nsl
Enter port number [389]:
Create self-signed certificate database [yes]:
Enter secure port number [636]:
Enter Directory Manager DN [cn=Directory Manager]: cn=Manager 
Enter the Directory Manager password: ********
Confirm the Directory Manager Password: ********
Enter the database suffix (or enter "none" to skip) [dc=nsl,dc=tuis,dc=ac,dc=jp]:
Create sample entries in the suffix [no]: yes
Do you want to start the instance after the installation? [yes]:
Are you ready to install? [no]: yes
Starting installation...
Completed installation for nsl
 
Page Top
firewall anchor.png
# firewall-cmd --add-service=ldap --permanent
# firewall-cmd --add-service=ldaps --permanent
# firewall-cmd --reload
Page Top
起動 anchor.png
  • systemctl start dirsrv@[Directory server identifier]
Page Top

check anchor.png

  • TLS を使う場合は /etc/openldap/ldap.conf に TLS_REQCERT never を追加
ex.) ldapsearch -x -H ldap://localhost -D cn=Manager -W -b dc=nsl,dc=tuis,dc=ac,dc=jp
ex.) ldapsearch -x -H ldaps://localhost -D cn=Manager -W -b dc=nsl,dc=tuis,dc=ac,dc=jp
 
Page Top

属性値の変更 anchor.png

Page Top
変更例 anchor.png
  • dapmodify -x -H ldap://202.26.150.51 -D cn=Manager -W -f change.ldif
# cat change.ldif
dn: cn=config
changetype: modify
replace: nsslapd-security
nsslapd-security: on
Page Top
aci 内部属性の変更 anchor.png
  • 一般ユーザに userPassword の変更権限の aci内部属性を与える
  • ldapmodify -x -H ldap://202.26.150.51 -D cn=Manager -W -f userPass.ldif
# cat userPass.ldif
dn: dc=nsl,dc=tuis,dc=ac,dc=jp
changetype: modify
add: aci
aci: (targetattr = "userPassword") (version 3.0; acl
 "modify own password"; allow (write) userdn = "ldap:///self";)
Page Top
ldapサーバが相手の証明書をチェックしない anchor.png
  • cn=config
    • nsslapd-tls-check-crl : none
    • nsslapd-ssl-check-hostname : off
       
Page Top

Replication anchor.png

Page Top
Cockpit を使った Replication (389-ds => 389-ds) anchor.png
  • Supplier --> Consumer ならうまくいく
    • Agreement で Consumer のデータベースを初期化する.
    • ldaps(636)で通信する場合は,「ldapサーバが相手の証明書をチェックしない」ようにする.
  • Supplier <--> Supplier がダメ
  • Consumer を Cockpit で削除しようとすると,389-ds が止まって削除できない.ログ関連のエラー?
 
Page Top
OpenLDAP => 389-ds anchor.png
  • syncprovモジュールを使用する.(?)
  • Consumer(389-ds) から Supplier(OpenLDAP)に聞きに行く形.
     
Page Top

Trouble Shooting anchor.png

Page Top
パスワードの変更に失敗しました。 サーバーのメッセージ: Insufficient access rights anchor.png
  • 一般ユーザにパスワード変更の権限がない(err=50)
  • 上記の 「aci 内部属性の変更」 を参照
     
Page Top

old(1.3系) anchor.png

Page Top

Install anchor.png

# dnf module enable 389-ds
# dnf install 389-ds-base
# dnf install 389-ds-base-legacy-tools
Page Top

Setup anchor.png

# setup-ds.pl 
  • ほぼデフォルトでOK
    • Computer name は DNSで引けるものにする.
    • Directory server identifier は他と被らないようにする.(ex. nsl)
  • 失敗した場合は /tmp に作られる log をチェックする.
  • /etc/dirsrv/slapd-[Directory server identifier]/ が作られる.(ex. /etc/dirsrv/slapd-nsl/)
  • LDAPI が作られない.Cockpit でアクセスできない.
     
Page Top

Execute anchor.png

# systemctl start dirsrv@[Directory server identifier]

ex.) systemctl start dirsrv@nsl
 
Page Top
check anchor.png
  • ex.) ldapsearch -x -H ldap://localhost -D cn=Manager -W -b dc=nsl,dc=tuis,dc=ac,dc=jp
     
Page Top

TLS anchor.png

Page Top
サーバ証明書 (p12ファイル) anchor.png
# cd /etc/dirsrv
# mkdir certs
# cd certs
# mkdir private
# openssl genrsa 2048 > private/private.key
# openssl req -new -x509 -key private/private.key -out server.crt -days 3650
# openssl pkcs12 -export -inkey private/private.key -in server.crt -out server.p12 -nodes -name Server-Cert
   p12ファイルのパスワードを設定
 
Page Top
389 へ配置 anchor.png
# pk12util -i server.p12 -d /etc/dirsrv/slapd-nsl
   Internal (Software) Token のパスワードを設定
  • 確認
    # certutil -d /etc/dirsrv/slapd-nsl -L
    
    Certificate Nickname                                         Trust Attributes
                                                                 SSL,S/MIME,JAR/XPI
    
    Server-Cert                                                  u,u,u
Page Top
389のファイル設定 anchor.png
  • /etc/dirsrv/slapd-nsl/pin.txt (Internal (Software) Tokenのパスワードを設定)
    Internal (Software) Token:pass
  • /etc/dirsrv/slapd-nsl/ldaps.ldif
    dn: cn=config
    changetype: modify
    replace: nsslapd-security
    nsslapd-security: on
  • ldaps.ldif の変更を反映
    # ldapmodify -x -H ldap://localhost -D cn=Manager -W -f ldaps.ldif
     LDAPのパスワードを入力
  • /etc/openldap/ldap.conf に TLS_REQCERT never を追加
     
Page Top
firewall anchor.png
# firewall-cmd --add-service=ldap --permanent
# firewall-cmd --add-service=ldaps --permanent
# firewall-cmd --reload
Page Top
check anchor.png
# systemctl restart dirsrv@nsl
# ldapsearch -x -H ldaps://localhost -D cn=Manager -W -b dc=nsl,dc=tuis,dc=ac,dc=jp
 

トップ   凍結 差分 バックアップ 複製 名前変更 リロード   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom
Counter: 2342, today: 1, yesterday: 8
最終更新: 2022-10-19 (水) 11:57:17 (JST) (553d) by iseki

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 4月翌月
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
<今日>

オンライン状況

55 人のユーザが現在オンラインです。 (5 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 55

もっと...

アクセスカウンタ

今日 : 9999
昨日 : 9457945794579457
総計 : 2332705623327056233270562332705623327056233270562332705623327056
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com