linux samba 配置ldap认证,linux – 使用LDAP进行身份验证的Samba独立服务器:SID不匹配...

我正试图让我的新samba服务器运行几天,我开始失去理智而不知道我做错了什么.这是我的设置:

OpenLDAP 2.4.21服务器,包含~15个组和> 100个用户,所有服务器都具有存储在LDAP中的unix和samba密码,以及分配和存储在LDAP中的用户SID和主要组SID,这些服务器来自SID LDAP服务器.

现在我想使用几个samba服务器来使用LDAP服务器来验证用户.

samba服务器是使用ldap服务器配置NSS / PAM的linux. getent passwd / group返回所有用户,ssh到samba机器适用于所有用户.现在这是smb.conf:

[global]

workgroup = XXXXX

security = user

passdb backend = ldapsam:ldap://myldapserver

ldap suffix = dc=mydomain,dc=com

ldap admin dn = cn=replicator,dc=mydomain,dc=com

ldap user suffix = ou=users

ldap group suffix = ou=groups

ldap machine suffix = ou=computers

ldap ssl = start tls

ldap连接正常工作,如pdbedit -L所示

pm_process() returned Yes

smbldap_search_domain_info: Searching for:[(&(objectClass=sambaDomain)(sambaDomainName=SAMBAHOSTNAME))]

StartTLS issued: using a TLS connection

smbldap_open_connection: connection opened

ldap_connect_system: successful connection to the LDAP server

The LDAP server is successfully connected

smbldap_search_paged: base => [dc=mydomain,dc=com],filter => [(&(uid=*)(objectclass=sambaSamAccount))],scope => [2],pagesize => [1024]

smbldap_search_paged: search was successful

sid S-1-5-21-[LDAPSID]-5168 does not belong to our domain

然后最后一条消息重复所有uid.

使用smbclient -L localhost -U someid日志文件说:

check_ntlm_password: Checking password for unmapped user [XXX]\[someid]@[SAMBAHOST] with the new password interface

check_ntlm_password: mapped user is: [SAMBAHOST]\[someid]@[SAMBAHOST]

StartTLS issued: using a TLS connection

smbldap_open_connection: connection opened

ldap_connect_system: successful connection to the LDAP server

The LDAP server is successfully connected

init_sam_from_ldap: Entry found for user: someid

Home server: SAMBAHOST

Home server: SAMBAHOST

init_group_from_ldap: Entry found for group: 1011

init_group_from_ldap: Entry found for group: 1011

Primary group S-1-5-21-[LDAPSID]-1000 for user someid is a UNKNOWN and not a domain group

Forcing Primary Group to 'Domain Users' for someid

ntlm_password_check: Checking NTLMv2 password with domain [CIN]

sam_account_ok: Checking SMB password for user someid

The primary group domain sid(S-1-5-21-[LOCALSID]-513) does not match the domain sid(S-1-5-21-[LDAPSID]) for someid(S-1-5-21-[LDAPSID]-5708)

check_sam_security: make_server_info_sam() Failed with 'NT_STATUS_UNSUCCESSFUL'

check_ntlm_password: Authentication for user [someid] -> [someid] Failed with error NT_STATUS_UNSUCCESSFUL

我在这里看到的是samba服务器无法识别用户的主要组(LDAP中的现有组),因此将主要组映射到其本地“Domain Users”组,然后显然与domainSID不匹配用户ID.

但是为什么samba服务器不能识别该组?或者是否存在不同的潜在问题?

到目前为止我尝试了什么:

将samba服务器的SID更改为LDAP服务器的SID,但net setlocalsid S -…未更改本地SID.没有错误消息,只是成功执行但getlocalsid返回旧的SID.

将samba服务器的domainsid设置为ldap服务器的SID. net setdomainsid S -…成功但samba服务器仍然拒绝对用户进行身份验证.

尝试使用net join XXX将服务器添加到域,但答案只是“独立服务器无法加入域”.

我试图运行smbpasswd -a将用户添加到本地samba数据库(即使这不是最终解决方案的选项,但这是其他用户推荐的),但错误没有改变.

如何告诉samba忽略域SID不匹配或强制samba与LDAP具有相同的SID?或者这会导致其他问题,如果~10 Samba Server和LDAP最终都具有完全相同的SID?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值