無法讓兩台 Ubuntu 14.04 計算機透過 Samba 運作

無法讓兩台 Ubuntu 14.04 計算機透過 Samba 運作

首先,我使用 Samba,因為雖然主要電腦是 Ubuntu 14.04,但我有 Windows 筆記型電腦。這些筆記型電腦應該獲得對主資料庫的讀取存取權。主資料庫位於我的「伺服器」上,它是 Ubuntu 機器之一。

我從一個問題轉到下一個問題,但似乎無法解決。幫助將不勝感激。

以下是要求:

-我想要共用/編輯的資料庫位於其中一台 Ubuntu 機器上的 /home/valleysecurity/Documents/Shared/ ,我將其稱為「伺服器」。該資料夾中有資料夾和檔案。
- 在所有 Ubuntu 電腦上都有相同的使用者、管理員、valleysecurity 和技術支援。每個使用者在每台電腦上都有相同的 SID 和密碼。 - 只有這些使用者可以編輯/更改/修改檔案和資料夾。 - 建立新文件或資料夾時,它應具有與資料夾層次結構的其餘部分相同的安全屬性:使用者 = {whoeverCreatedit},群組 = Valleygatehouse。 - 所有三個使用者都定義在「valleygatehouse」群組中。
- 所有電腦都在一個名為「valleygatehouse」的工作群組中

當前問題:

從客戶端,我可以看到 Valleygatehouse 群組,但是,當我單擊該群組時,我會被要求輸入密碼。挑戰已經填寫了 userid,這就是我現在的用戶。它不會接受密碼並繼續要求輸入密碼。我該如何解決?

注意:我很困惑是否使用 Nautilus 內建的功能、Samba 使用者介面,還是編輯 .conf 檔案或其他什麼。看來他們的目的是互相矛盾的。另外,「目前」文件在命名約定方面到處都是。例如,smbusers 與 users 來包含用戶,以及該文件是否應包含所有用戶以及其他一些內容或僅包含一個用戶?啊啊!

附言。我可以透過使用 Nautilus 更改所有資料夾以允許來賓使用 Samba 並允許“其他”進行 RW 來消除此問題。但這違背了安全要求。另外,當我在客戶端上建立新文件時,其使用者是“nobody”,其群組是“nobody”。

到那時,smb.conf 有什麼關係呢?

伺服器smb.conf:


[global]

    workgroup = valleygatehouse
    server string = %h server (Samba, Ubuntu)
    server role = standalone server
    dns proxy = no
    name resolve order = lmhosts wins bcast host
    log file = /var/log/samba/log.%m
    max log size = 1000
    syslog = 0
    panic action = /usr/share/samba/panic-action %d
    encrypt passwords = no
;   passdb backend = tdbsam
;   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
;   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan  for
# sending the correct chat script for the passwd program in Debian Sarge).
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

    guest account = nobody
;   username map = /etc/samba/smbusers


[Shared]
    comment = Valley Security documents
    path = /home/valleysecurity/Documents/Shared
    browseable = yes
    guest ok = yes
    available = yes
    writeable = yes
    read only = no
    username = valleysecurity,admin,technicalsupport
    create mask = 0775
    directory mask = 0775
[printers]
    comment = All Printers
    browseable = yes
    path = /var/spool/samba
    printable = yes
    guest ok = yes
    read only = no
    create mask = 0700
[print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers
    browseable = yes
    writeable = yes
    read only = no

客戶端 smb.conf


[global]
   workgroup = valleygatehouse
   server string = Samba Server
   server role = standalone server
   log file = /usr/local/samba/var/log.%m
   max log size = 50
   dns proxy = no 
[homes]
   comment = Home Directories
   browseable = no
   writable = yes
[printers]
    comment = All Printers
    browseable = yes
    path = /var/spool/samba
    printable = yes
    guest ok = yes
    read only = no
    create mask = 0700
[print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers
    browseable = yes
    writeable = yes
    read only = no

答案1

嘗試使用

valid users = valleysecurity,admin,technicalsupport

代替

username = valleysecurity,admin,technicalsupport

並確保已在“伺服器”上建立使用者/密碼。

我的機器運行配置與您的“伺服器端”smb.conf 類似,但用戶欄位除外。希望有幫助。

答案2

每次我在linux中設定具有write權限的samba伺服器時,我都會執行命令「smbpasswd 'username'」將用戶新增為samba用戶,注意該用戶應該首先在系統中。

相關內容