我有一台工作半径服务器,用于对与 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 守护程序无法启动,错误为 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.tecmint.com/integrate-centos-7-to-samba4-active-directory/。
现在我可以以 security=ads 的域成员身份成功启动 smb/samba 服务,使用 AD 凭据登录并通过 Windows 资源管理器打开主目录。
祝你好运...