【发布时间】:2023-03-31 05:33:01
【问题描述】:
在开始我的问题之前: 我有一个受反向代理(nginx)保护的网站。所以不允许客户端直接连接到网站。它必须连接到nginx,然后nginx显示网站的内容。
现在我想添加更多“安全”功能。我安装了 samba4,因为它可用作 AD DC,并希望使用 LDAP(包含在 samba4 中?)来验证试图访问网站的客户端。 因此,在客户端真正看到网站之前,它必须连接到 nginx,然后验证自己(使用 LDAP 凭据),然后才能查看网站内容。
我使用模块 ldap_http_authentication 配置了 nginx(参见下面的配置)并且它正在工作。当客户端尝试查看网站时,我需要使用一些 LDAP 凭据登录,但是当我尝试对客户端进行身份验证时,它就不起作用了。它说 LDAP 凭据是错误的。 当 LDAP 带有 samba 时,如何添加 LDAP 用户?我只是不知道要使用哪些凭据。我在 samba 中添加了一些用户,例如“test”,并尝试使用他们的凭据进行身份验证,但它们效果不佳。 那么我必须为“binddn”和“binddn_passwd”使用哪些凭据?我必须在哪里创建或获取它们?
我的 nginx ldap 配置:
ldap_server adds {
url "ldap://192.168.50.131/dc=test,dc=dom?sAMAccountName?sub?";
binddn "TEST\\USERNAME";
binddn_passwd "password";
connect_timeout 5s;
bind_timeout 5s;
request_timeout 5s;
require valid_user;
satisfy any;
}
谢谢!
编辑: 我尝试使用以下命令添加一些用户:
ldapadd -x -D cn=admin,dc=test,dc=dom -W -f add_user.ldif
但它只是返回: “输入 LDAP 密码:ldap_bind:需要强(er)身份验证(8)附加信息:BindSimple:需要传输加密。”
顺便说一句:我从未设置过 LDAP 密码,我只是安装了 samba4。就是这样!
【问题讨论】:
标签: authentication nginx active-directory ldap samba