使用 LDAP 的方式认证


1、实际上也有二种

一种用 open***-auth-ldap 即直接通过 LDAP 验证,

一种与 mysql 认证相似使用 pam-ldap -->通过 PAM -->然后再找 LDAP 验证。

这里主要用 open***-auth-ldap (另一方法,安装 yum install nss_ldap 包后找文件 /usr/local/etc/auth-ldap.conf 复制 /usr/share/doc/nss_ldap_253/ldap.conf.pam_ldap /etc/pam_ldap.conf ,创建/etc/pam.d/open***)


2、自动安装

yum install open***-auth-ldap   #会生成open***-auth-ldap.so文件

yum install openldap-clients    #会生成ldap.conf文件

yum install -y ldap_utils   #用于启用ldapsearch功能


3、生成open***-auth-ldap.so

yum安装目录为:/usr/lib64/open***/plugin/lib/open***-auth-ldap.so


4、将open***-auth-ldap.so拷贝到open***的配置文件目录下

cp /usr/lib64/open***/plugin/lib/open***-auth-ldap.so /etc/open***/


5.配置ldap配置文件

/usr/share/doc/open***-auth-ldap-2.0.3/auth-ldap.conf   #该文件不能和open***的server.conf配置文件放在同一目录下,否则open***启动失败。可以新建一个目录放在里面。

#####################################################


        # LDAP server URL
        URL             ldap://192.168.1.1:389

        # Bind DN (If your LDAP server doesn't support anonymous binds)
        # BindDN                uid=Manager,ou=People,dc=example,dc=com
        BindDN     "cn=open***,cn=Users,dc=dev,dc=com"               #Users为目录名
        Password   "123456"

        # Bind Password
        # Password      SecretPassword

        # Network timeout (in seconds)
        Timeout         15

        # Enable Start TLS
        TLSEnable       no

        # Follow LDAP Referrals (anonymously)
        FollowReferrals yes

        # TLS CA Certificate File
        TLSCACertFile   /usr/local/etc/ssl/ca.pem

        # TLS CA Certificate Directory
        TLSCACertDir    /etc/ssl/certs

        # Client Certificate and key
        # If TLS client authentication is required
        TLSCertFile     /usr/local/etc/ssl/client-cert.pem
        TLSKeyFile      /usr/local/etc/ssl/client-key.pem

        # Cipher Suite
        # The defaults are usually fine here
        # TLSCipherSuite        ALL:!ADH:@STRENGTH


        # Base DN
        BaseDN          "ou=dev,ou=group,dc=dev,dc=com"           #group为目录名

        # User Search Filter
        # SearchFilter  "(&(sAMAccountName=%u)(accountStatus=active))"
        SearchFilter "(&(sAMAccountName=%u))"

        # Require Group Membership
        RequireGroup    false

        # Add non-group members to a PF table (disabled)
        #PFTable        ips_***_users

       

                BaseDN "ou=groups,ou=dev,ou=group,dc=kaolafm,dc=com"
                SearchFilter    "ou=ldapgroups"                  #安全组
                MemberAttribute Member
                # Add group members to a PF table (disabled)
                #PFTable        ips_***_eng
       

################################################################

测试ldap查询功能

#windows 查询方法

ldapsearch -LLL -x -h 172.28.4.103 -D "[email protected]" -W -b "dc=syswin,dc=com" "*"


6、open***配置文件更改配置为使用ldap认证

plugin /etc/open***/open***-auth-ldap.so "/etc/open***/auth/ldap.conf"


7、重启open***服务

service open*** restart



常见错误日志解决方法:


open*** 未能配置 DHCP 服务。接口可能已经断开。

Wed Aug 01 08:42:13 2012 ERROR: netsh command failed: returned error code 1

Wed Aug 01 08:42:18 2012 NETSH: C:\WINDOWS\system32\netsh.exe interface ip set address 本地连接 3 dhcp

未能配置 DHCP 服务。接口可能已经断开。

原因:

open*** 虚拟网卡被配置了IP 地址

改成自动获取就OK了

1、连接后自动断开重连

原因:账号在其它地方登录


2、连接后无法ping通内网地址

原因:未使用管理员身份登录


3、虚拟网卡不正常

解决方案:已管理员身份运行del,再运行add


4、出现以下日志:

CreateFile failed on TAP device: \\.\Global\{71EAA8E6-2C6F-4C1C-A1A5-BFD3D5A9B36

E}.tap

All TAP-Win32 adapters on this system are currently in use.

解决方案:请检查TAP-WIN32虚拟网卡是否被禁用了,如果被禁用了就会出现上述情况,请双击启用即可。网络共享中心-适配器设置,打开网络连接,找到带有“TAP-WIN32”的网卡,双击启用,重新连接***


Open××× an error occurred installing the tap device driver

开机启动项去掉重新安装


linux

open***出现‘Cannot allocate TUN/TAP dev dynamically’的解决办法


在2.6的内核中,默认的虚拟接口是tunl0,但是通过阅读OPEN×××的代码,它默认的接口是tun0,所以会找不到设备,发生以上错误。

解决方法:手动指定网络接口

在/etc/init.d/open***(open***的启动脚本)中,找到$open*** --daemon --writepid ...这行,加上参数$open*** --dev tunl0 --daemon --writepid ...,这样就可以了。