NIS/NFSv3 をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
NFSv3サーバを作る
NIS/NFSサーバにユーザをログインさせる必要がないのならNIS/...
NISサーバで作成したユーザの設定値確認として ypbind を使う...
ログインさせないような手立てが必要なのかも。
例えば
-ssh経由のみ許可
-/etc/ssh/sshd_configでAllowUsersを使用してログインユーザ...
-netgroupを定義して、nsswitch.confでcompatを使用してユー...
らを行う。NFSサーバにも有効かと
***NFSv3構築 [#td3b2463]
NFSv3で公開する場所は /export とします。
#code(nonumber){{
[root@nfs ~]# yum install nfs-utils
[root@nfs ~]# chkconfig nfs on
[root@nfs ~]# cat << _EOF_ > /etc/exports
/export *.chaperone.jp(rw)
_EOF_
[root@nfs ~]# exportfs -av
exporting *.chaperone.jp:/export
[root@nfs ~]#
}}
簡単には再起動、もしくは
#code(nonumber){{
[root@nfs ~]# /etc/init.d/rpcbind start
[root@nfs ~]# /etc/init.d/nfs start
}}
にて構築は完了である
***ホームディレクトリ作成 [#ac249112]
authconfigの「&color(magenta){--enablemkhomedir};」は静的...
autofsとかの動的にNFSマウント先が決まる形式だと無理だった
その場合、手動でホームディレクトリを用意するしかなく、sab...
#code(nonumber){{
[root@nfs ~]# rm -rf /export/saber && cp -r /etc/skel /ex...
}}
として作る。NISのauto.homeに従い他のユーザのホームディレ...
#code(nonumber){{
saber -rw nfs:/export/saber
illya -rw nfs:/export/illya
}}
&color(magenta){ypcat passwd};と&color(magenta){ypcat -k ...
#code(perl){{
#!/usr/bin/perl
use strict;
my @v=();
my (%u, %g) = ();
open(USR, "ypcat passwd |");
while(<USR>){
@v = split(/:/);
$u{$v[0]}=$v[2];
$g{$v[0]}=$v[3];
}
close(USR);
@v=();
open(HOME,"ypcat -k auto.home |sort |");
while(<HOME>){
if(/^(\S+)\s+(\S+)\s+(\S+)$/){
@v=split(/:/,$3);
print "cp -r /etc/skel ".$v[1]." && chown -R ".$u{$1...
}
}
close(HOME);
}}
***autofs [#s52f2f81]
auto.master、auto.homeが定義されていれば、クライアントのa...
#code(nonumber){{
[root@client ~]# /etc/init.d/autofs start
[root@client ~]# cd /home/saber
[root@client saber]# df -Th |grep nfs
nfs:/export/saber nfs 5.5G 859M 4.3G 17% /home/saber
[root@client saber]#
}}
***_netdev [#v3775fb1]
NFSとかをmountするなら、この「_netdev」を付けるとnetwork...
#code(nonumber){{
nfs:/export/home /home nfs defaults,_netdev 0 0
}}
終了行:
NFSv3サーバを作る
NIS/NFSサーバにユーザをログインさせる必要がないのならNIS/...
NISサーバで作成したユーザの設定値確認として ypbind を使う...
ログインさせないような手立てが必要なのかも。
例えば
-ssh経由のみ許可
-/etc/ssh/sshd_configでAllowUsersを使用してログインユーザ...
-netgroupを定義して、nsswitch.confでcompatを使用してユー...
らを行う。NFSサーバにも有効かと
***NFSv3構築 [#td3b2463]
NFSv3で公開する場所は /export とします。
#code(nonumber){{
[root@nfs ~]# yum install nfs-utils
[root@nfs ~]# chkconfig nfs on
[root@nfs ~]# cat << _EOF_ > /etc/exports
/export *.chaperone.jp(rw)
_EOF_
[root@nfs ~]# exportfs -av
exporting *.chaperone.jp:/export
[root@nfs ~]#
}}
簡単には再起動、もしくは
#code(nonumber){{
[root@nfs ~]# /etc/init.d/rpcbind start
[root@nfs ~]# /etc/init.d/nfs start
}}
にて構築は完了である
***ホームディレクトリ作成 [#ac249112]
authconfigの「&color(magenta){--enablemkhomedir};」は静的...
autofsとかの動的にNFSマウント先が決まる形式だと無理だった
その場合、手動でホームディレクトリを用意するしかなく、sab...
#code(nonumber){{
[root@nfs ~]# rm -rf /export/saber && cp -r /etc/skel /ex...
}}
として作る。NISのauto.homeに従い他のユーザのホームディレ...
#code(nonumber){{
saber -rw nfs:/export/saber
illya -rw nfs:/export/illya
}}
&color(magenta){ypcat passwd};と&color(magenta){ypcat -k ...
#code(perl){{
#!/usr/bin/perl
use strict;
my @v=();
my (%u, %g) = ();
open(USR, "ypcat passwd |");
while(<USR>){
@v = split(/:/);
$u{$v[0]}=$v[2];
$g{$v[0]}=$v[3];
}
close(USR);
@v=();
open(HOME,"ypcat -k auto.home |sort |");
while(<HOME>){
if(/^(\S+)\s+(\S+)\s+(\S+)$/){
@v=split(/:/,$3);
print "cp -r /etc/skel ".$v[1]." && chown -R ".$u{$1...
}
}
close(HOME);
}}
***autofs [#s52f2f81]
auto.master、auto.homeが定義されていれば、クライアントのa...
#code(nonumber){{
[root@client ~]# /etc/init.d/autofs start
[root@client ~]# cd /home/saber
[root@client saber]# df -Th |grep nfs
nfs:/export/saber nfs 5.5G 859M 4.3G 17% /home/saber
[root@client saber]#
}}
***_netdev [#v3775fb1]
NFSとかをmountするなら、この「_netdev」を付けるとnetwork...
#code(nonumber){{
nfs:/export/home /home nfs defaults,_netdev 0 0
}}
ページ名:
1