我在 ubuntu 伺服器上設定了 samba,並嘗試在sharedfolders
根目錄中共用資料夾。但是,我0x80070043
在 Windows 中收到此錯誤。
root@ubuntu:~# ls -lh sharedfolders/
total 12K
drwxrwxrwx 2 root root 4.0K May 26 16:10 f1
drwxrwxrwx 2 root root 4.0K May 26 16:10 f2
drwxrwxrwx 2 root root 4.0K May 26 16:11 f3
這是我的 samba 設定檔:
[global]
workgroup = KIWI
server string = %h server (Samba, Ubuntu)
wins support = yes
dns proxy = no
name resolve order = lmhosts host wins bcast
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = user
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
[Shared]
comment = Shared Files
path = sharedfolders/f1
browseable = yes
read only = no
[Home Files]
comment = Home Files
path = sharedfolders/f2
browseable = yes
read only = no
[Work Files]
comment = Work Files
path = sharedfolders/f3
browseable = yes
read only = no
當我嘗試連接到上述資料夾之一(f1、f2、f3)時,我提供了 samba 中定義的使用者密碼,但出現了這個奇怪的錯誤。
有人可以幫我解決這個問題嗎?
這是我的森巴狀態:
root@ubuntu:~# smbstatus
Samba version 4.3.11-Ubuntu
PID Username Group Machine Protocol Version
------------------------------------------------------------------------------
Service pid machine Connected at
-------------------------------------------------------
No locked files
更新:
這是我的三個共用資料夾所在的根資料夾的權限:
root@ubuntu:~# ls -lh
total 4.0K
drwxrwxrwx 5 root root 4.0K May 26 16:11 sharedfolders
圖片附件:
答案1
要解決的第一個問題是 Samba 設定檔中沒有正確定義共用路徑。
例如,這裡:
[Shared] path = sharedfolders/f1
您需要提供絕對路徑(即以 開頭的路徑/
),而不是相對路徑。
您將在 Samba 日誌檔案中看到錯誤訊息的原因。您已經定義了它們,所以請使用它們。
答案2
您共享的資料夾存在一些權限問題:
解決方案是將其移動到/mnt/sharedfolders/
mv sharedfolders/ /mnt/
進而 :
chown -R www-data sharedfolders
然後相應地更新 samba 設定檔中的路徑,
然後當然:
service smbd restart
希望這有效。