LoginSignup
0
0

More than 3 years have passed since last update.

LDAPクライアント&NFSマウント

Last updated at Posted at 2018-09-17

debian 系のディストリビューションで LDAP のクライアントをインストールし,NFS サーバからディレクトリをマウントする。

LDAP クライアント

必要なパッケージをインストール:

$ sudo apt install nscd libnss-ldap libpam-ldap ldap-utils

インストール中に以下のようにウィザードが表示されるので設定を入れていく。

  1. LDAP サーバの URI を入力 (ホスト名やIPアドレス,ポート番号など)。image.png
  2. LDAP search base を入力。image.png
  3. LDAP プロトコルバージョンを選択。image.png
  4. image.png
  5. image.png
  6. 撮り忘れ
  7. 撮り忘れ
  8. image.png
  9. image.png
  10. image.png
$ 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

設定にミスがなければ,上手くマウントできるはずです.

以上!!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0