NFS エクスポートをマウントするとアクセスが拒否されます
環境
- ONTAP 9
- NFSv4
- RHEL 7.
問題
- RHEL クライアントへの root としての NFSv4 エクスポートのマウントが失敗する:
# mount -vv -o nfsvers=4.0,sec=sys nfsserver:/rootjunction/directory1/ /mnt/tmpmnt/
mount.nfs: timeout set for Thu Jan13 12:19:34 2022
mount.nfs: trying text-based options 'sec=sys,vers=4.1,addr=192.168.0.2,clientaddr=192.168.0.3'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'sec=sys,vers=4.0,addr=192.168.0.2,clientaddr=192.168.0.3'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting nfsserver:/rootjunction/directory1
- 入力
vserver nfs show
NFSv4
が有効になりますmount-as-root
が有効になりますNFSv4-id-domain
ユーザのドメインに設定されていることを確認します- デフォルトユーザはです
nobody
- UNIX セキュリティ形式のボリュームへの Linux アクセスには、ユーザ / グループのネームマッピングや設定は必要なく、権限も必要ありません。
cluster1::*> vserver security file-directory show -vserver nfsserver -path /rootjunction Vserver: nfsserver File Path: /rootjunction File Inode Number: 64 Security Style: unix Effective Style: unix DOS Attributes: 10 DOS Attributes in Text: ----D--- Expanded Dos Attributes: - UNIX User Id: 0 UNIX Group Id: 0 UNIX Mode Bits: 2750 UNIX Mode Bits in Text: rwxr-s--- ACLs: -
- エクスポートポリシーにルートの引き下げが設定されています
cluster1::> vserver export-policy rule show -vserver sv1 -policyname nfsexport -ruleindex 2 -instance
Vserver: nfsserver
Policy Name: nfsexport
Rule Index: 2
Access Protocol: nfs4
List of Client Match Hostnames, IP Addresses, Netgroups, or Domains: 192.168.0.0/24
RO Access Rule: any
RW Access Rule: any
User ID To Which Anonymous Users Are Mapped: 65534
Superuser Security Types: none
Honor SetUID Bits in SETATTR: true
Allow Creation of Devices: true
- マウントされているディレクトリに対する実行権限が付与されている場合に成功します