debian 系のディストリビューションで LDAP のクライアントをインストールし,NFS サーバからディレクトリをマウントする。
LDAP クライアント
必要なパッケージをインストール:
$ sudo apt install nscd libnss-ldap libpam-ldap ldap-utils
インストール中に以下のようにウィザードが表示されるので設定を入れていく。
$ sudo nano /etc/nsswitch.conf
/etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
- passwd: compat
+ passwd: compat ldap
- group: compat
+ group: compat ldap
- shadow: compat
+ shadow: compat ldap
gshadow: files
hosts: files mdns4_minimal [NOTFOUND=return] dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
$ getent passwd
うまくいけば,ユーザ一覧が出てくる.
$ sudo nano /etc/pam.d/sshd
/etc/pam.d/sshd
+ session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
$ sudo reboot
LDAPユーザでログイン→成功
NFS マウント
$ sudo apt install nfs-common
$ sudo nano /etc/fstab
/etc/fstab
+ xxx.xxx.xxx.xxx:/volume/hoge /mnt nfs defaults 0 0
$ sudo mount -a
設定にミスがなければ,上手くマウントできるはずです.
以上!!!