
我目前正在嘗試設定我的家庭 samba 伺服器,以便客人只能讀取而不能寫入/刪除
我已經這樣設定了,我既可以讀也可以寫
[share]
comment = Ubuntu Share
path = /your/samba/share
browsable = yes
guest ok = yes
read only = no
write list = user
create mask = 0755
如果我將“只讀”編輯為“是”,我將無法再寫入,並且沒有收到用戶/密碼的提示,我只收到“權限被拒絕”錯誤
我正在使用 ubuntu 伺服器並從 win 10 機器和 Android 裝置存取共享
請幫忙順便說一句,我還是 Linux 新手!
答案1
儘管有“寫入清單”規範,但視窗仍會將其視為公共共享,並且不會提示輸入憑證。
有幾個選項:
[1] 不允許匿名公共存取共用。將“客人可以”設定為“否”:
[share]
comment = Ubuntu Share
path = /your/samba/share
browsable = yes
guest ok = no
read only = yes
write list = user
create mask = 0755
現在,存取該共享的每個人都必須傳遞憑證,但只有一個使用者可以寫入。這迫使您建立一個虛擬來賓使用者 - 例如 smbuser - 使用簡單的虛擬 samba 密碼 - 例如 smbuserpw - 以便所有來賓使用者傳遞到伺服器。
[2] 建立 2 個分享 - 一個訪客只讀:
[share-Public]
comment = Ubuntu Share
path = /your/samba/share
browsable = yes
guest ok = yes
read only = yes
並且只有那些擁有正確憑證的人才能寫入:
[share-Private]
comment = Ubuntu Share
path = /your/samba/share
browsable = yes
guest ok = no
read only = no
valid users = user
create mask = 0755