Ldap client: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
 
(4 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 9: Zeile 9:
 
*-w sysadm  Passwort
 
*-w sysadm  Passwort
 
*-LLL weniger Ausgaben
 
*-LLL weniger Ausgaben
 +
 +
 +
Wenn man das Zertifikat angeben möchte, muss folgendes vor ldapsearch hinzugefügt werden:
 +
env LDAPTLS_CACERT=cert.pem ldapsearch ...
 +
 
=ldapadd=
 
=ldapadd=
 
  ldapadd -x -D cn=admin,dc=linuggs,dc=de -w sysadm -f service-container.ldif
 
  ldapadd -x -D cn=admin,dc=linuggs,dc=de -w sysadm -f service-container.ldif
Zeile 28: Zeile 33:
 
==delete==
 
==delete==
 
<pre>
 
<pre>
ldpamodify -xD "cn=admin,dc=linuggs,dc=de" -W
+
ldapmodify -xD "cn=admin,dc=linuggs,dc=de" -W
 
dn: uid=thomas.will,ou=linuggs.de,ou=Domains,dc=linuggs,dc=de
 
dn: uid=thomas.will,ou=linuggs.de,ou=Domains,dc=linuggs,dc=de
 
changetype: modify
 
changetype: modify
 
delete: mailForwardingAddress
 
delete: mailForwardingAddress
 
</pre>
 
</pre>
 +
 
==replace==
 
==replace==
 
<pre>
 
<pre>
Zeile 42: Zeile 48:
  
 
=ldapdelete=
 
=ldapdelete=
ldapdelete opens a connection to an LDAP server, binds, and deletes one or more entries. If one or more dn arguments are provided, entries with those Distinguished Names are deleted. Each dn should be a string-represented DN as defined in RFC 1779. If no dn arguments are provided, a list of DNs is read from standard input (or from file if the -f flag is used).
+
ldapdelete dient dazu auf einem LDAP-Server einen oder mehrere Einträge zu löschen. Falls ein oder mehrere DN (Distinguished Name) angegeben werden, werden dieser (oder diese) gelöscht. Falls kein DN angegeben wird, erfolgt das Einlesen über die Standardeingabe.
 
<pre>
 
<pre>
ldapdelete 'cn=Thomas Will,o=TUDelft,c=DE'  
+
ldapdelete 'cn=Thomas Will,dc=linuggs,dc=DE'  
  
ldapdelete -v 'cn=Thomas Will,o=TUDelft,c=NL' -D 'cn=Jan Leininger,o=TUDelft,c=DE' -W  
+
ldapdelete -v 'cn=Thomas Will,dc=linuggs,dc=DE' -D 'cn=Jan Leininger,dc=linuggs,dc=DE' -W  
 
</pre>
 
</pre>
  

Aktuelle Version vom 21. Oktober 2019, 12:46 Uhr

installation

apt-get install ldap-utils

ldapsearch

 ldapsearch  -x -b dc=linuggs,dc=de -D "cn=admin,dc=linuggs,dc=de" -w sysadm -LLL
  • -x simple bind
  • -b dc=linuggs,dc=de (basis root)
  • -D "cn=admin,dc=linuggs,dc=de" zu benutzender Account
  • -w sysadm Passwort
  • -LLL weniger Ausgaben


Wenn man das Zertifikat angeben möchte, muss folgendes vor ldapsearch hinzugefügt werden:

env LDAPTLS_CACERT=cert.pem ldapsearch ...

ldapadd

ldapadd -x -D cn=admin,dc=linuggs,dc=de -w sysadm -f service-container.ldif

ldapmodify

add

ldpamodify -xD "cn=admin,dc=linuggs,dc=de" -W
dn: uid=thomas.will,ou=linuggs.de,ou=Domains,dc=linuggs,dc=de
changetype: modify
add: mailAlternateAddress
mailAlternateAddress: thomas@linuggs.de
-
add: mailAlternateAddress
mailAlternateAddress: thomas.will@schmeich.de
-
add: mailForwardingAddress
mailForwardingAddress: barzi@gmail.com

delete

ldapmodify -xD "cn=admin,dc=linuggs,dc=de" -W
dn: uid=thomas.will,ou=linuggs.de,ou=Domains,dc=linuggs,dc=de
changetype: modify
delete: mailForwardingAddress

replace

dn: uid=thomas.will,ou=linuggs.de,ou=Domains,dc=linuggs,dc=de
changetype: modify
replace: mailMessageStore
mailMessageStore: /home/thomas/

ldapdelete

ldapdelete dient dazu auf einem LDAP-Server einen oder mehrere Einträge zu löschen. Falls ein oder mehrere DN (Distinguished Name) angegeben werden, werden dieser (oder diese) gelöscht. Falls kein DN angegeben wird, erfolgt das Einlesen über die Standardeingabe.

ldapdelete 'cn=Thomas Will,dc=linuggs,dc=DE' 

ldapdelete -v 'cn=Thomas Will,dc=linuggs,dc=DE' -D 'cn=Jan Leininger,dc=linuggs,dc=DE' -W 

ldappasswd

ldappasswd -x -D "cn=admin,dc=xinux,dc=org" -w sysadm "uid=nuttela,ou=users,dc=xinux,dc=org"  -s wiggel

links