I need a command in Linux to know if OpenLDAP user have password or not
- User
I need a command in Linux to know if OpenLDAP user have password or not
- Assistant
You can use the
ldappasswdcommand to check if an OpenLDAP user has a password. Here's an example of how to do it:ldappasswd -D "cn=admin,dc=example,dc=com" -x -w admin_password -H ldap://ldap.example.com -s new_password "uid=user,ou=people,dc=example,dc=com"Replace
cn=admin,dc=example,dc=comwith the bind DN of your LDAP admin,admin_passwordwith the password of your admin,ldap://ldap.example.comwith the LDAP server URI,uid=user,ou=people,dc=example,dc=comwith the DN of the user you want to check, andnew_passwordwith the new password you want to set. If the user already has a password, it will prompt you to enter the old password. If the user does not have a password, it will set the new password without requiring the old one.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.