Show Table of Contents
16.4. 設定例
16.4.1. SELinux ラベルが付いた NFS サポートを有効にする
以下の例では、SELinux ラベルが付いた NFS サポートを有効にする方法を示しています。ここでは、nfs-utils パッケージがインストール済みで SELinux ターゲットポリシーが使用されており、SELinux が enforcing モードで実行中であることを前提としています。
注記
次のステップ 1 からステップ 3 までは、NFS サーバー
nfs-srv で行います。
- NFS サーバーが稼働している場合は、これを停止します。
[nfs-srv]#
systemctl stop nfsサーバーが停止したことを確認します。[nfs-srv]#
systemctl status nfsnfs-server.service - NFS Server Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled) Active: inactive (dead) /etc/sysconfig/nfsファイルを編集して、RPCNFSDARGSフラグを"-V 4.2"に設定します。# Optional arguments passed to rpc.nfsd. See rpc.nfsd(8) RPCNFSDARGS="-V 4.2"
- サーバーを再起動して、稼働していることを確認します。出力は以下のようになり、タイムスタンプのみが異なります。
[nfs-srv]#
systemctl start nfs[nfs-srv]#
systemctl status nfsnfs-server.service - NFS Server Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled) Active: active (exited) since Wed 2013-08-28 14:07:11 CEST; 4s ago - クライアント側で NFS サーバーをマウントします。
[nfs-client]#
mount -o v4.2 server:mntpoint localmountpoint - すべての SELinux ラベルがサーバーからクライアントに渡されました。
[nfs-srv]$
ls -Z file-rw-rw-r--. user user unconfined_u:object_r:svirt_image_t:s0 file [nfs-client]$ls -Z file-rw-rw-r--. user user unconfined_u:object_r:svirt_image_t:s0 file
注記
ラベルが付いた NFS サポートをホームディレクトリーやその他のコンテンツに有効にすると、そのコンテンツは EXT ファイルシステム上にある場合と同様のラベルが付けられます。また、異なるバージョンの NFS があるシステムをマウントしたり、ラベルが付いた NFS をサポートしないサーバーのマウントを試みると、エラーが返されることに留意してください。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.