NFSサーバーをグローバルに書き込み可能にする

NFSサーバーをグローバルに書き込み可能にする

ネットワーク上のすべてのサーバーで書き込むことができるNFSサーバーをRaspberry Piに構築しようとしています。 NFS共有は、起動時にマウントされる外部デバイスのディレクトリです。

$ cat /etc/fstab
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1

# This is my external device
/dev/sda1 /data                 ext4    defaults,nofail         0       2

私の設定は/etc/exports次のとおりです。

$ cat /etc/exports   
/data *(rw,sync,all_squash,no_subtree_check,anonuid=1000,anongid=1000)
/data/share *(rw,sync,all_squash,no_subtree_check,anonuid=1000,anongid=1000)

ユーザーIDとグループID 1000は、/ dataと/ data / shareの両方を所有するpiユーザーとpiグループです。

$ ls -la /data
total 28
drwxrwxrwx  4 pi   pi    4096 Sep 30 08:41 .
drwxr-xr-x 23 root root  4096 Oct  9 15:54 ..
drwx------  2 pi   pi   16384 Sep 25 14:57 lost+found
drwxrwxrwx  2 pi   pi    4096 Sep 30 08:41 share

Macで共有をマウントしようとすると、次のエラーが発生します。

$ mount 192.168.101.10:/data tmp
mount_nfs: can't mount /data from 192.168.101.10 onto /Users/davejlong/Downloads/tmp: Operation not permitted

これが出力ですexportfs -v

$ sudo exportfs -v
/data           <world>(rw,wdelay,root_squash,all_squash,no_subtree_check,anonuid=1000,anongid=1000)
/data/share     <world>(rw,wdelay,root_squash,all_squash,no_subtree_check,anonuid=1000,anongid=1000)

私の構成にどのような問題があるのか​​わかりません。

ベストアンサー1

もちろん、私は質問をした直後に答えを見つけました:facepalm:

insecureエクスポートにオプションを追加する必要があるようです。

$ cat /etc/exports   
/data *(rw,sync,all_squash,no_subtree_check,insecure,anonuid=1000,anongid=1000)
/data/share *(rw,sync,all_squash,no_subtree_check,anonuid=1000,anongid=1000)

おすすめ記事