1

What is the correct syntax to edit a value in an LDAP dn? As of now I was trying the following:

serveradmin@magic:~$ ldapmodify -x -W -D cn=admin,dc=example,dc=com <<EOF
> dn: uid=foo,ou=People,dc=example,dc=com
> changetype: modify
> edit: loginShell
> loginShell: /bin/false
> EOF

However that returns the following error:

ldapmodify: modify operation type is missing at line 3, entry "uid=foo,ou=People,dc=example,dc=com"

So I'm assuming the edit is not a correct operation type. So what is the correct syntax to edit a users login shell?

CertifcateJunky
  • 143
  • 1
  • 6

1 Answers1

0

The correct syntax to modify a entry is with the keyword replace. So in order to modify the login shell of the user, the command would look like this:

serveradmin@magic:~$ ldapmodify -x -W -D cn=admin,dc=example,dc=com <<EOF
> dn: uid=foo,ou=People,dc=example,dc=com
> changetype: modify
> replace: loginShell
> loginShell: /bin/false
> EOF
CertifcateJunky
  • 143
  • 1
  • 6