memorandum
FrontPage
管理
ヘルプ
NISサーバ & NFSサーバ
をテンプレートにして作成
開始行:
*概要 [#i732f35e]
NIS(Network Information Service)サーバ。コンピュータの情...
NISを使うと、サーバの/etcにある設定ファイルなどをクライア...
ココでは、サーバのIPアドレスは192.168.0.4で、クライアント...
通常、NISはNFSと連携して/homeディレクトリをサーバのNFS共...
サーバとクライアントの構成はこのような感じ。
#ref(nisnfs.png)
サーバの/etc以下のファイルを提供して、オートマウント情報...
*サーバ側の設定 [#p2353028]
**インストール [#ofefc610]
ypsev(NISサーバ)をインストールする。
# apt-get install ypserv
パッケージリストを読みこんでいます... 完了
依存情報ツリーを作成しています... 完了
以下のパッケージが新たにインストールされます:
ypserv
アップグレード: 0 個, 新規インストール: 1 個, 削除: 0 個...
130kB のアーカイブを取得する必要があります。
展開後に 268kB のディスク容量が追加消費されます。
取得:1 http://updates.vinelinux.org 3.1/i386/plus ypserv...
130kB を 0s 秒で取得しました (325kB/s)
変更を適用しています...
Preparing... ############################...
1:ypserv ############################...
完了
**NISの設定 [#ccfb2055]
/etc/hostsを編集する。
# vi /etc/hosts
>
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
192.168.0.4 pc7dk3.niwaka.ddo.jp ←サーバのI...
NISドメインhatenaを登録する。
# domainname hatena
# domainname
hatena
ちなみに、manpageを見ると、
domainname - システムの NIS/YP ドメイン名を表示・設定する
nisdomainname - システムの NIS/YP ドメイン名を表示・設定...
ypdomainname - システムの NIS/YP ドメイン名を表示・設定...
という感じに、どのコマンドを使っても同じらしい。
上のままだと再起動すると消えちゃうので、
# vi /etc/sysconfig/network
>
NISDOMAIN=hatena
を追加する。
ypserv.confの編集。
# vi /etc/ypserv.conf
>
# Not everybody should see the shadow passwords, not sec...
# under MSDOG everbody is root and can access ports < 10...
192.168.0. : * : shadow.by...
192.168.0. : * : passwd.ad...
auto.masterの編集。これは、サーバのNFS共有ディレクトリに...
# vi /etc/auto.master
>追加
/home yp :auto.home
ローカルの/homeディレクトリにyp(NIS)から配布されたauto.ho...
auto.homeの編集。これは、上のauto.masterから呼び出される...
# vi /etc/auto.home
>
* -fstype=nfs,rw,soft,rsize=8192,wsize=8192 ...
ローカルの/homeディレクトリ下のすべてのディレクトリ(*)に...
Makefileを編集して提供するファイルを指定する。
# vi /var/yp/Makefile
>
# If you don't want some of these maps built, feel free ...
# them out from this list.
#all: passwd group hosts rpc services netid protocols m...
# netgrp shadow publickey networks ethers bootpa...
# amd.home auto.master auto.home auto.local pass...
# timezone locale netmasks
all: passwd group hosts shadow auto.master auto.home \
portmapとypservを起動させる。
# /etc/rc.d/init.d/portmap start
Starting portmapper: ...
# /etc/rc.d/init.d/ypserv start
YPサーバサービスを起動中: ...
自動起動の設定。
# chkconfig ypserv on ←NISサーバデーモン
# chkconfig yppasswdd on ←クライアントからパスワードを変...
NISデータベース(マップ)の作成を行う。これでサーバに登録さ...
# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts ...
servers. pc7dk3.niwaka.ddo.jp is in the list of NIS ser...
the names for the other hosts, one per line. When you a...
list, type a <control D>.
next host to add: pc7dk3.niwaka.ddo.jp
next host to add:
The current list of NIS servers looks like this:
pc7dk3.niwaka.ddo.jp
Is this correct? [y/n: y] y
We need a few minutes to build the databases...
Building /var/yp/yokabai/ypservers...
Running /var/yp/Makefile...
gmake[1]: ディレクトリ `/var/yp/yokabai' に入ります
Updating passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
Updating hosts.byname...
Updating hosts.byaddr...
Updating shadow.byname...
Updating shadow.bynumber...
Updating auto.master...
Updating auto.home...
gmake[1]: ディレクトリ `/var/yp/yokabai' から出ます
pc7dk3.niwaka.ddo.jp has been set up as a NIS master ser...
Now you can run ypinit -s pc7dk3.niwaka.ddo.jp on all sl...
**NFSの設定 [#x12b24c0]
NFS共有ディレクトリの作成。今後は/nishomeをサーバ・クライ...
# mv /home /nishome
マウントポイントの作成。
# mkdir /home
/nishomeを共有するために/etc/exportsを編集する。
# vi /etc/exports
>追加
/nishome 192.168.0.0/24(rw,no_root_squash)
NFSの再起動。
# /etc/init.d/nfs restart
Shutting down NFS mountd: ...
Shutting down NFS daemon: ...
Shutting down NFS services: ...
Starting NFS services: ...
Starting NFS daemon: ...
Starting NFS mountd: ...
//**サーバ上でautofsが起動しないようにする [#w4ccdcc3]
//今のauto.master設定ファイルだとクライアントでは問題ない...
// # /etc/init.d/autofs stop
// Stopping automounter: ...
//
// # chkconfig autofs off
// # chkconfig autofs --list
// autofs 0:off 1:off 2:off 3:off 4:off ...
*クライアント側の設定 [#ga89af40]
**インストール [#l1487a2d]
ypbind(NISクライアント)をインストールする。
# apt-get install ypbind
パッケージリストを読みこんでいます... 完了
依存情報ツリーを作成しています... 完了
以下の追加パッケージがインストールされます:
yp-tools
以下のパッケージが新たにインストールされます:
yp-tools ypbind
アップグレード: 0 個, 新規インストール: 2 個, 削除: 0 個...
108kB のアーカイブを取得する必要があります。
展開後に 214kB のディスク容量が追加消費されます。
続行しますか? [Y/n]y
取得:1 http://updates.vinelinux.org 3.1/i386/main yp-too...
取得:2 http://updates.vinelinux.org 3.1/i386/main ypbind...
108kB を 0s 秒で取得しました (188kB/s)
変更を適用しています...
Preparing... ############################...
1:yp-tools ############################...
2:ypbind warning: /etc/yp.conf create...
########################################### [100%]
完了
**NISの設定 [#s4920b83]
NISドメインの登録。サーバに登録したものと同じものを入力。
# domainname hatena
# domainname
hatena
# vi /etc/sysconfig/network
>
NISDOMAIN=hatena
を追加する。
ネームサービススイッチファイルの編集。nisを追加。
# vi /etc/nsswitch.conf
>
passwd: files nis
shadow: files nis
group: files nis
hosts: files dns nis
automount: files nisplus nis
yp.confの編集。NISサーバのドメインとNISサーバのアドレスを...
# vi /etc/yp.conf
>
#domain localdomain broadcast
domain hatena server 192.168.0.4
authconfigの編集。
# vi /etc/sysconfig/authconfig
>
USEDB=no
USEHESIOD=no
Upt-SELDAP=no
USENIS=yes ←NISを有効にする
USEWINBIND=no
USEKERBEROS=no
USELDAPAUTH=no
USEMD5=yes
USESHADOW=yes
USESMBAUTH=no
DHCPクライアントを使っている場合、dhcpcdによってyp.confが...
# vi /etc/sysconfig/network-scripts/ifup
>
# DHCP clients need DNS to be available, and we don't know
# what DNS server they're using until they are done.
FWHACK=
if [ -n "$FWACTIVE" -a "$FIREWALL_MODS" != "no" ]; t...
ipchains -I input -s 0/0 53 -d 0/0 1025:65535 -p...
FWHACK=1
fi
if [ -x /sbin/dhcpcd -Y] && /sbin/dhcpcd -Y ${DHCPCD...
echo $" done."
↑/sbin/dhcpcd -Y ←-Yオプションをつける(yp.confを上書きし...
portmapとypbindを起動させる。
# /etc/init.d/portmap start
Starting portmapper: ...
# /etc/init.d/ypbind start
Binding to the NIS domain... ...
Listening for an NIS domain server: 192.168.0.4
動作確認。
# ypwhich
192.168.0.4
# ypcat passwd
nistest:$1$cpnjpAjq$9o.85Wnp173rga1A9Bamf.:503:503::/hom...
**NFSの設定 [#w8ef3380]
現在のホームディレクトリの名前を変える。
# mv /home /home-local
マウント用のホームディレクトリを作る。ココは空じゃないと...
# mkdir /home
autofsを再起動。サーバでデータベースの更新を行った時点で...
# /etc/init.d/autofs restart
Stopping automounter: ...
Starting automounter: ...
statusで確認し、うまくいったら以下のように表示される。
# /etc/init.d/autofs status
Configured Mount Points:
------------------------
/usr/sbin/automount /home yp auto.home
Active Mount Points:
--------------------
/usr/sbin/automount /home yp auto.home
マウントされるか確認
# ls /home/
としただけではマウントされない。
# ls /home/nistest/
lib/ rpm/
とやって初めてマウントされる。つまり、デーモン起動直後に...
マウントされたことを確認するには、
# df
ファイルシステム 1k-ブロック 使用中 空き 使用%...
/dev/sda2 3565696 955828 2428736 29% /
/dev/sda1 46633 10547 33678 24% ...
none 127740 0 127740 0% ...
192.168.0.4:/nishome/nistest
8143576 1254212 6475692 17% ...
こんな感じで表示される。
動作確認
# su - nistest
[nistest@localhost nistest]$
**クライアントからパスワードを変更するには [#j8eced8a]
[nistest@localhost nistest]$ yppasswd -p
Changing NIS account information for nistest on pc7dk3.n...
Please enter old password:
Changing NIS password for nistest on pc7dk3.niwaka.ddo.jp.
Please enter new password:
Please retype new password:
The NIS password has been changed on pc7dk3.niwaka.ddo.jp.
* コメント [#wf5e6b6f]
#comment
終了行:
*概要 [#i732f35e]
NIS(Network Information Service)サーバ。コンピュータの情...
NISを使うと、サーバの/etcにある設定ファイルなどをクライア...
ココでは、サーバのIPアドレスは192.168.0.4で、クライアント...
通常、NISはNFSと連携して/homeディレクトリをサーバのNFS共...
サーバとクライアントの構成はこのような感じ。
#ref(nisnfs.png)
サーバの/etc以下のファイルを提供して、オートマウント情報...
*サーバ側の設定 [#p2353028]
**インストール [#ofefc610]
ypsev(NISサーバ)をインストールする。
# apt-get install ypserv
パッケージリストを読みこんでいます... 完了
依存情報ツリーを作成しています... 完了
以下のパッケージが新たにインストールされます:
ypserv
アップグレード: 0 個, 新規インストール: 1 個, 削除: 0 個...
130kB のアーカイブを取得する必要があります。
展開後に 268kB のディスク容量が追加消費されます。
取得:1 http://updates.vinelinux.org 3.1/i386/plus ypserv...
130kB を 0s 秒で取得しました (325kB/s)
変更を適用しています...
Preparing... ############################...
1:ypserv ############################...
完了
**NISの設定 [#ccfb2055]
/etc/hostsを編集する。
# vi /etc/hosts
>
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
192.168.0.4 pc7dk3.niwaka.ddo.jp ←サーバのI...
NISドメインhatenaを登録する。
# domainname hatena
# domainname
hatena
ちなみに、manpageを見ると、
domainname - システムの NIS/YP ドメイン名を表示・設定する
nisdomainname - システムの NIS/YP ドメイン名を表示・設定...
ypdomainname - システムの NIS/YP ドメイン名を表示・設定...
という感じに、どのコマンドを使っても同じらしい。
上のままだと再起動すると消えちゃうので、
# vi /etc/sysconfig/network
>
NISDOMAIN=hatena
を追加する。
ypserv.confの編集。
# vi /etc/ypserv.conf
>
# Not everybody should see the shadow passwords, not sec...
# under MSDOG everbody is root and can access ports < 10...
192.168.0. : * : shadow.by...
192.168.0. : * : passwd.ad...
auto.masterの編集。これは、サーバのNFS共有ディレクトリに...
# vi /etc/auto.master
>追加
/home yp :auto.home
ローカルの/homeディレクトリにyp(NIS)から配布されたauto.ho...
auto.homeの編集。これは、上のauto.masterから呼び出される...
# vi /etc/auto.home
>
* -fstype=nfs,rw,soft,rsize=8192,wsize=8192 ...
ローカルの/homeディレクトリ下のすべてのディレクトリ(*)に...
Makefileを編集して提供するファイルを指定する。
# vi /var/yp/Makefile
>
# If you don't want some of these maps built, feel free ...
# them out from this list.
#all: passwd group hosts rpc services netid protocols m...
# netgrp shadow publickey networks ethers bootpa...
# amd.home auto.master auto.home auto.local pass...
# timezone locale netmasks
all: passwd group hosts shadow auto.master auto.home \
portmapとypservを起動させる。
# /etc/rc.d/init.d/portmap start
Starting portmapper: ...
# /etc/rc.d/init.d/ypserv start
YPサーバサービスを起動中: ...
自動起動の設定。
# chkconfig ypserv on ←NISサーバデーモン
# chkconfig yppasswdd on ←クライアントからパスワードを変...
NISデータベース(マップ)の作成を行う。これでサーバに登録さ...
# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts ...
servers. pc7dk3.niwaka.ddo.jp is in the list of NIS ser...
the names for the other hosts, one per line. When you a...
list, type a <control D>.
next host to add: pc7dk3.niwaka.ddo.jp
next host to add:
The current list of NIS servers looks like this:
pc7dk3.niwaka.ddo.jp
Is this correct? [y/n: y] y
We need a few minutes to build the databases...
Building /var/yp/yokabai/ypservers...
Running /var/yp/Makefile...
gmake[1]: ディレクトリ `/var/yp/yokabai' に入ります
Updating passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
Updating hosts.byname...
Updating hosts.byaddr...
Updating shadow.byname...
Updating shadow.bynumber...
Updating auto.master...
Updating auto.home...
gmake[1]: ディレクトリ `/var/yp/yokabai' から出ます
pc7dk3.niwaka.ddo.jp has been set up as a NIS master ser...
Now you can run ypinit -s pc7dk3.niwaka.ddo.jp on all sl...
**NFSの設定 [#x12b24c0]
NFS共有ディレクトリの作成。今後は/nishomeをサーバ・クライ...
# mv /home /nishome
マウントポイントの作成。
# mkdir /home
/nishomeを共有するために/etc/exportsを編集する。
# vi /etc/exports
>追加
/nishome 192.168.0.0/24(rw,no_root_squash)
NFSの再起動。
# /etc/init.d/nfs restart
Shutting down NFS mountd: ...
Shutting down NFS daemon: ...
Shutting down NFS services: ...
Starting NFS services: ...
Starting NFS daemon: ...
Starting NFS mountd: ...
//**サーバ上でautofsが起動しないようにする [#w4ccdcc3]
//今のauto.master設定ファイルだとクライアントでは問題ない...
// # /etc/init.d/autofs stop
// Stopping automounter: ...
//
// # chkconfig autofs off
// # chkconfig autofs --list
// autofs 0:off 1:off 2:off 3:off 4:off ...
*クライアント側の設定 [#ga89af40]
**インストール [#l1487a2d]
ypbind(NISクライアント)をインストールする。
# apt-get install ypbind
パッケージリストを読みこんでいます... 完了
依存情報ツリーを作成しています... 完了
以下の追加パッケージがインストールされます:
yp-tools
以下のパッケージが新たにインストールされます:
yp-tools ypbind
アップグレード: 0 個, 新規インストール: 2 個, 削除: 0 個...
108kB のアーカイブを取得する必要があります。
展開後に 214kB のディスク容量が追加消費されます。
続行しますか? [Y/n]y
取得:1 http://updates.vinelinux.org 3.1/i386/main yp-too...
取得:2 http://updates.vinelinux.org 3.1/i386/main ypbind...
108kB を 0s 秒で取得しました (188kB/s)
変更を適用しています...
Preparing... ############################...
1:yp-tools ############################...
2:ypbind warning: /etc/yp.conf create...
########################################### [100%]
完了
**NISの設定 [#s4920b83]
NISドメインの登録。サーバに登録したものと同じものを入力。
# domainname hatena
# domainname
hatena
# vi /etc/sysconfig/network
>
NISDOMAIN=hatena
を追加する。
ネームサービススイッチファイルの編集。nisを追加。
# vi /etc/nsswitch.conf
>
passwd: files nis
shadow: files nis
group: files nis
hosts: files dns nis
automount: files nisplus nis
yp.confの編集。NISサーバのドメインとNISサーバのアドレスを...
# vi /etc/yp.conf
>
#domain localdomain broadcast
domain hatena server 192.168.0.4
authconfigの編集。
# vi /etc/sysconfig/authconfig
>
USEDB=no
USEHESIOD=no
Upt-SELDAP=no
USENIS=yes ←NISを有効にする
USEWINBIND=no
USEKERBEROS=no
USELDAPAUTH=no
USEMD5=yes
USESHADOW=yes
USESMBAUTH=no
DHCPクライアントを使っている場合、dhcpcdによってyp.confが...
# vi /etc/sysconfig/network-scripts/ifup
>
# DHCP clients need DNS to be available, and we don't know
# what DNS server they're using until they are done.
FWHACK=
if [ -n "$FWACTIVE" -a "$FIREWALL_MODS" != "no" ]; t...
ipchains -I input -s 0/0 53 -d 0/0 1025:65535 -p...
FWHACK=1
fi
if [ -x /sbin/dhcpcd -Y] && /sbin/dhcpcd -Y ${DHCPCD...
echo $" done."
↑/sbin/dhcpcd -Y ←-Yオプションをつける(yp.confを上書きし...
portmapとypbindを起動させる。
# /etc/init.d/portmap start
Starting portmapper: ...
# /etc/init.d/ypbind start
Binding to the NIS domain... ...
Listening for an NIS domain server: 192.168.0.4
動作確認。
# ypwhich
192.168.0.4
# ypcat passwd
nistest:$1$cpnjpAjq$9o.85Wnp173rga1A9Bamf.:503:503::/hom...
**NFSの設定 [#w8ef3380]
現在のホームディレクトリの名前を変える。
# mv /home /home-local
マウント用のホームディレクトリを作る。ココは空じゃないと...
# mkdir /home
autofsを再起動。サーバでデータベースの更新を行った時点で...
# /etc/init.d/autofs restart
Stopping automounter: ...
Starting automounter: ...
statusで確認し、うまくいったら以下のように表示される。
# /etc/init.d/autofs status
Configured Mount Points:
------------------------
/usr/sbin/automount /home yp auto.home
Active Mount Points:
--------------------
/usr/sbin/automount /home yp auto.home
マウントされるか確認
# ls /home/
としただけではマウントされない。
# ls /home/nistest/
lib/ rpm/
とやって初めてマウントされる。つまり、デーモン起動直後に...
マウントされたことを確認するには、
# df
ファイルシステム 1k-ブロック 使用中 空き 使用%...
/dev/sda2 3565696 955828 2428736 29% /
/dev/sda1 46633 10547 33678 24% ...
none 127740 0 127740 0% ...
192.168.0.4:/nishome/nistest
8143576 1254212 6475692 17% ...
こんな感じで表示される。
動作確認
# su - nistest
[nistest@localhost nistest]$
**クライアントからパスワードを変更するには [#j8eced8a]
[nistest@localhost nistest]$ yppasswd -p
Changing NIS account information for nistest on pc7dk3.n...
Please enter old password:
Changing NIS password for nistest on pc7dk3.niwaka.ddo.jp.
Please enter new password:
Please retype new password:
The NIS password has been changed on pc7dk3.niwaka.ddo.jp.
* コメント [#wf5e6b6f]
#comment
ページ名:
検索
AND検索
OR検索
編集操作
一覧
単語検索
最終更新
バックアップ
ヘルプ
トップページ
http://kayanomori.net/
↑
アクセス数
本日:0人
昨日:0人
総数:0人
現在:6人
最新の20件
2022-07-16
投票箱
2022-01-30
FrontPage
2022-01-29
めも
2018-02-03
SandBox
PukiWiki
InterWikiName
FormattingRules
PukiWiki/1.4/Manual/Plugin/O-R
PukiWiki/1.4/Manual/Plugin/S-U
InterWiki
日本語
複数画像アップ掲示板 ECOUP(エコアップ) v1.31
日記/2006-12-12
日記
日記/2005-10-04
特定のオートコンプリート履歴だけを削除する
日記/2005-10-06
小ネタ集/WordPress
日記/2005-10-05
整形ルール
edit