Tag: openldap

Ruby net-ldap添加用户

我试图通过这样做使用ldap创建一个新用户: require ‘net/ldap’ ldap = Net::LDAP.new ldap.host = ‘ldap’ ldap.auth(‘uid=myuser,ou=users,dc=my,dc=domain,dc=com’, ‘mypass’) ldap.bind # this executes successfully, up to this point, all is well dn = ‘uid=newuser,ou=users,dc=my,dc=domain,dc=com’ attributes = { cn: ‘newuser’, sn: ‘surname’, objectclass: [‘top’, ‘agent’] } ldap.add(dn: dn, attributes: attributes) ldap.get_operation_result #=> # 我是ldap的新手,我无法在网上找到一个提供如何使用net-ldap创建新用户的明确示例。