NetBSD 9.3 - NFS 設定 /etc/exports

NetBSD 9.3 - NFS 設定 /etc/exports

我正在嘗試設定 NFS,但在 /etc/exports 方面遇到了一些問題

當我的 /etc/exports 檔案的內容是這樣的:

/data1 192.168.1.213(rw)

我從 showmount -e 192.168.1.245 得到這個

client$ showmount -e 192.168.1.245
Exports list on 192.168.1.245:
client$

但是當我的 /etc/exports 檔案中有這個:

/data1 -alldirs -network 192.168.1.245 -mask 255.255.255.0
/data2 -alldirs -network 192.168.1.245 -mask 255.255.255.0

從這裡:https://www.netbsd.org/docs/guide/en/chap-net-services.html

我從 showmount -e 192.168.1.245 得到這個

client$ showmount -e 192.168.1.245
Exports list on 192.168.1.245:
/data2                             192.168.1.245 
/data1                             192.168.1.245

我可以在我的客戶端電腦(也是 NetBSD 9.3)上掛載 data1 和 data2,但當我嘗試複製檔案、mkdir 等時,權限被拒絕

讀這個: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_file_systems/exporting-nfs-shares_managing-file-systems 我知道這是 /etc/exports 的一般格式:

export host(options)

我想要實現的目標如下:網路上的每台電腦(192.168.1.*),無論使用者連接什麼,都可以掛載我的伺服器(192.168.1.245)上提供的具有讀寫權限的任何掛載點NFS

閱讀 RedHat 文檔,我了解到它是這樣的:

/data1 host(rw,all_squash,anonuid=1000,anongid=100)

gid 和 uid 設定為與我的名為 user (非 root)的使用者匹配

但我不知道從這裡該做什麼。

更新 接受的答案解決了問題,我現在面臨權限問題:NetBSD 9.3 - NFS 權限

答案1

您可以在根據 NetBSD 指南建立的檔案-mapall=1000:100中新增行。/etc/exports

該文件的文檔exports可以透過運行在 NetBSD 系統上查看man exports,或在 Web 上查看https://man.netbsd.org/NetBSD-9.3/exports.5

相關內容