Debian 11 Bullseye
Sponsored Link

NIS : クライアントの設定2021/09/06

 
NIS クライアントの設定をして、NIS サーバーのユーザーアカウントでログインできるようにします。
[1] サーバー側と同じ NIS システムをインストールします。
root@node01:~#
apt -y install nis
[2] NIS クライアントとしての設定です。
root@node01:~#
vi /etc/yp.conf
#
# yp.conf       Configuration file for the ypbind process. You can define
#               NIS servers manually here if they can't be found by
#               broadcasting on the local net (which is the default).
#
#               See the manual page of ypbind for the syntax of this file.
#
# IMPORTANT:    For the "ypserver", use IP addresses, or make sure that
#               the host is in /etc/hosts. This file is only interpreted
#               once, and if DNS isn't reachable yet the ypserver cannot
#               be resolved and ypbind won't ever bind to the server.

# ypserver ypserver.network.com
# 最終行へ追記 [domain (ドメイン名) server (NIS マスターサーバーのホスト名 or IP アドレス)]

domain srv.world server dlp.srv.world
root@node01:~#
vi /etc/nsswitch.conf
# 7行目 : 以下のように追記

passwd:         files systemd nis
group:          files systemd nis
shadow:         files nis
gshadow:        files

hosts:          files dns nis

root@dlp:~#
vi /etc/defaultdomain
# 新規作成 : ドメイン名を設定

srv.world
# 必要であれば以下も対応

root@node01:~#
vi /etc/pam.d/common-session
# 最終行に追記 (初回ログイン時にホームディレクトリを自動作成)

session optional        pam_mkhomedir.so skel=/etc/skel umask=077

root@node01:~#
systemctl restart rpcbind nscd ypbind

root@node01:~#
systemctl enable rpcbind ypbind

root@node01:~#
node01 login: bullseye     # NIS 登録ユーザー
Password:
Linux node01.srv.world 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Creating directory '/home/bullseye'.
bullseye@node01:~$     # ログインできた

# NIS パスワード変更は以下の通り

bullseye@node01:~$
Changing NIS account information for bullseye on dlp.srv.world.
Please enter old password:
Changing NIS password for bullseye on dlp.srv.world.
Please enter new password:
Please retype new password:

The NIS password has been changed on dlp.srv.world.

bullseye@node01:~$
関連コンテンツ