研究室のSolarisサーバ設定覚書part 4

  1. d:id:rigarash:20070807
  2. d:id:rigarash:20070809
  3. d:id:rigarash:20070813

の続きになります。今回はクライアント側の設定その1です。

Solaris 10のLDAPクライアントとしての設定

前回までの準備で、LDAPのサーバ側の準備が整ったので、これからクライアント側の設定をします。
まず、SSL certificateの準備です*1

# certutil -A -n "Example CA Certificate" -i /root/cacertdb/cacert.pem -a -t CT -d /var/ldap
# chmod 444 /var/ldap/*.db

これで、ldapclientを動かす準備ができました。

# ldapclient init -a profileName=default -a proxyDN=cn=proxyagent,ou=profile,dc=example,dc=com -a proxyPassword=XXXXXX 192.168.0.1

この状態では、LDAPにない情報までLDAPを参照してしまったり、hosts検索でDNSを見てくれなかったりするので、/etc/nsswitch.confを編集します*2

# cat /etc/nsswitch.conf
(略)
# the following two lines obviate the "+" entry in /etc/passwd and /etc/group.
passwd:     files ldap
group:      files ldap

# consult /etc "files" only if ldap is down.
hosts:      ldap dns [NOTFOUND=return] files

# Note that IPv4 addresses are searched for in all of the ipnodes databases
# before searching the hosts databases.
ipnodes:    ldap dns [NOTFOUND=return] files

networks:   files
protocols:  files
rpc:        files
ethers:     files
netmasks:   files
bootparams: files
publickey:  files

netgroup:   ldap

automount:  ldap [NOTFOUND=return] files
(略)

次に、ログインのためにPAMエントリを修正します。とりあえず、sshとpasswdコマンドのみがきちんと動けばいいので、他の項目の変更は必要ないです*3

# cat /etc/pam.conf
(略)
#
# login service (explicit because of pam_dial_auth)
#
login   auth requisite          pam_authtok_get.so.1
login   auth required           pam_dhkeys.so.1
login   auth required           pam_unix_cred.so.1
login   auth sufficient         pam_unix_auth.so.1
login   auth required           pam_ldap.so.1
login   auth required           pam_dial_auth.so.1
(略)
#
# Default definitions for Authentication management
# Used when service name is not explicitly mentioned for authentication
#
other   auth requisite          pam_authtok_get.so.1
other   auth required           pam_dhkeys.so.1
other   auth required           pam_unix_cred.so.1
other   auth sufficient         pam_unix_auth.so.1
other   auth required           pam_ldap.so.1
#
# passwd command (explicit because of a different authentication module)
#
passwd  auth binding            pam_passwd_auth.so.1 server_policy
passwd  auth required           pam_ldap.so.1

*1:研究室注: /net/lucifer/export/site-init-files/cacert.pemにあります

*2:研究室注: /net/lucifer/site-init-files/nsswitch.conf.SunOSにあります

*3:研究室注: /net/lucifer/export/site-init-files/pam.conf.SunOSにファイルがあります