我有一個工作半徑伺服器,用於驗證與 PDC AD 伺服器的連接。我想創建另一個,以便在需要時可以在防火牆上進行故障轉移。我使用與第一個伺服器相同的配置創建了第二個伺服器。
當我的 smb.conf 中有以下內容時,它無法啟動,即使這是與另一個 IP 的工作伺服器相同的配置。
[global]
workgroup = domain
security = ads
password server = x.x.x.x
passdb backend = tdbsam
realm = realm.com
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
我在 systemctl start smb 上收到的錯誤如下:
Aug 30 09:12:46 zahqprdlrad002 systemd[1]: Starting Samba SMB Daemon...
Aug 30 09:12:46 zahqprdlrad002 smbd[21426]: [2018/08/30 09:12:46.156012, 0] ../source3/auth/auth_util.c:1399(make_new_session_info_guest)
Aug 30 09:12:46 zahqprdlrad002 smbd[21426]: create_local_token failed: NT_STATUS_NO_MEMORY
Aug 30 09:12:46 zahqprdlrad002 smbd[21426]: [2018/08/30 09:12:46.156515, 0] ../source3/smbd/server.c:2011(main)
Aug 30 09:12:46 zahqprdlrad002 smbd[21426]: ERROR: failed to setup guest info.
Aug 30 09:12:46 zahqprdlrad002 systemd[1]: smb.service: main process exited, code=exited, status=255/n/a
Aug 30 09:12:46 zahqprdlrad002 systemd[1]: Failed to start Samba SMB Daemon.
Aug 30 09:12:46 zahqprdlrad002 systemd[1]: Unit smb.service entered failed state.
Aug 30 09:12:46 zahqprdlrad002 systemd[1]: smb.service failed.
如果我從 smb.conf 中註解掉 security=ads,smb 會啟動,但隨後我無法連線到 PDC AD 伺服器來加入 AD。
Host is not configured as a member server.
Invalid configuration. Exiting....
Failed to join domain: This operation is only allowed for the PDC of the domain.
ADS join did not work, falling back to RPC...
cannot join as standalone machine
請幫忙 :)
答案1
我也遇到了Samba SMB daemon無法啟動的問題,錯誤為create_local_token failed: NT_STATUS_NO_MEMORY。
經過一段失敗的挫折後,我發現這篇文章建議新的 samba 網域成員設定需要 winbindd: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=899269#40
進一步挖掘發現了這篇文章https://timothygruber.com/linux/samba-file-server-with-microsoft-ad/最後我成功了——https://www.howtoing.com/integrate-centos-7-to-samba4-active-directory/。
現在,我可以使用 security=ads 作為網域成員成功啟動 smb/samba 服務,並使用 AD 憑證登入並透過 Windows 資源管理器開啟主目錄。
祝你好運...