ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
[root@ldaptest openldap]# ldapadd -x -D "cn=admin,dc=ultrapower,dc=com" -W -f /tmp/base.ldif
Enter LDAP Password:
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
[root@ldaptest openldap]# ldapadd -x -D "cn=admin,dc=ultrapower,dc=com" -W -f /tmp/group.ldif
Enter LDAP Password:
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
出现这个错误的时候,查看服务和端口都已经开启了,需要你手动指定主机名和你的端口号(ldap端口号为389),使用-h 加上主机名。
[root@ldaptest openldap]# ldapadd -x -D "cn=admin,dc=ultrapower,dc=com" -W -f /tmp/base.ldif -h ldaptest.ultrapower.com -p 389 Enter LDAP Password: adding new entry "dc=ultrapower,dc=com" adding new entry "ou=Hosts,dc=ultrapower,dc=com" adding new entry "ou=Rpc,dc=ultrapower,dc=com" adding new entry "ou=Services,dc=ultrapower,dc=com" adding new entry "nisMapName=netgroup.byuser,dc=ultrapower,dc=com" adding new entry "ou=Mounts,dc=ultrapower,dc=com" adding new entry "ou=Networks,dc=ultrapower,dc=com" adding new entry "ou=People,dc=ultrapower,dc=com" adding new entry "ou=Group,dc=ultrapower,dc=com"
……
*******VICTORY LOVES PREPARATION*******