![對 Samba 僅有讀取權限](https://rvso.com/image/1331439/%E5%B0%8D%20Samba%20%E5%83%85%E6%9C%89%E8%AE%80%E5%8F%96%E6%AC%8A%E9%99%90.png)
大家好,最近我在 Centos 5.5 上使用 Samba 遇到了很多麻煩。
我在Windows 7中開發並透過scp(ant任務)發送文件,但是它太慢並且想要徹底設定samba。
安裝並遵循一些指南後,我完成了以下操作:
- 禁用防火牆(iptables)
- 停用 SelLinux(一開始沒有這樣做,但也沒有幫助)
- 設定我的 smbusers 檔案以將我的 Windows 使用者對應到 root(root =“Tahir Malik”--> 有效)
- 使用指令 smbpasswd -a mitco 將目前使用者 mitco 新增至 sambapassdb ,因為 Windows 使用者只有讀取存取權限
因此,兩個用戶都具有對我的共享的讀取權限。這是我的 smb.conf 片段:
[global]
workgroup = MITCO
server string = Samba Server Version %v
netbios name = centos
; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
; hosts allow = 127. 192.168.12. 192.168.13.
[alf4]
comment = Alfresco 4
path = /opt
read only = no
valid users = mitco, mitco
force user = root
force group = root
admin users = mitco , mitco
writeable = yes
; browseable = yes
也許還重要的是 /opt 只能由 root 寫入,但這並不重要,因為我使用強制使用者和群組或管理員使用者。
日誌檔:
[2012/09/29 07:43:44, 0] smbd/server.c:main(958) smbd 版本 3.0.33-3.39.el5_8 啟動。版權所有Andrew Tridgell 和Samba 團隊1992-2008 [2012/09/29 07:43:59, 1] smbd/service.c:make_connection_snum(1085) mitco-tahir (192.168.1root.1) 最初連接到以 root 用戶服務alf4 (uid=0,gid=0)(pid 5228)
答案1
我真的不知道發生了什麼,但是在重新啟動 Linux 和 Windows 環境後,我擁有了對該共享的寫入存取權限。