0% found this document useful (0 votes)
98 views

Sobre LDAP: RFC 4510 RFC 4511

The document discusses the Lightweight Directory Access Protocol (LDAP) and attributes stored in an LDAP directory. It describes how LDAP attributes have defined data types that constrain attribute values, and how LDAP encodes values in an octet-aligned format. It then provides examples of LDAP search commands to view, add, and delete directory entries.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views

Sobre LDAP: RFC 4510 RFC 4511

The document discusses the Lightweight Directory Access Protocol (LDAP) and attributes stored in an LDAP directory. It describes how LDAP attributes have defined data types that constrain attribute values, and how LDAP encodes values in an octet-aligned format. It then provides examples of LDAP search commands to view, add, and delete directory entries.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Sobre LDAP

Each attribute stored in a Lightweight Directory Access Protocol (LDAP) directory [RFC4510], whose values may be transferred in the LDAP protocol [RFC4511], has a defined syntax (i.e., data type) that constrains the structure and format of its values. Estructura y formato de sus valores : sintaxis de los atributos del directorio

The LDAP-specific encoding of a given attribute syntax always produces octet-aligned values. valores en OCTETOS Each LDAP syntax is uniquely identified with an object identifier [ASN.1] represented in the dotted-decimal format (short descriptive names are not defined for syntaxes). Operaciones bsicas:

ldapsearch -x -b "dc=nodomain"

muestra todo pero no las passwd

ldapsearch -x -b "dc=nodomain" -D "cn=admin,dc=nodomain" -W

muestra todo, incluso las pass En el caso de que quiera personalizar el dc, el dominio de la organizaction

dpkg-reconfigure slapd

Para consultar en nuestro caso todos los users de cfg.sld.cu:

ldapsearch -x -b "dc=cfg,dc=sld,dc=cu" -D "cn=admin,dc=cfg,dc=sld,dc=cu" -w XXXX ldapsearch -x -b "dc=casa,dc=cfg,dc=cu" -D "cn=admin,dc=casa,dc=cfg,dc=cu" -W

Para filtar algn atributo, ejemplo el cn, con filter ldapsearch -x -b "dc=casa,dc=cfg,dc=cu" filter "cn" -D "cn=admin,dc=casa,dc=cfg,dc=cu" -W

En formato ldif, la salida del resultado

ldapsearch -x -LL -b "dc=casa,dc=cfg,dc=cu" filter "cn" -D "cn=admin,dc=casa,dc=cfg,dc=cu" -W

Para adicionar un ldif dn: ou=people, dc=casa,dc=cfg,dc=cu ou: people description: All people in organisation objectclass: organizationalunit dn: cn=John Smith,ou=people,dc=casa,dc=cfg,dc=cu objectclass: inetOrgPerson cn: John Smith cn: John J Smith sn: Smith uid: jsmith userpassword: jSmitH carlicense: HISCAR 124 homephone: 555-111-2223 mail: [email protected] mail: [email protected] mail: [email protected] ou: Sales

ldapadd -c -x -D "cn=admin,dc=casa,dc=cfg,dc=cu" -W -f /root/ejemplo.ldif

Para consultar las entradas con ou=People

ldapsearch -x -b "dc=casa,dc=cfg,dc=cu" filter "ou=People" -D "cn=admin,dc=casa,dc=cfg,dc=cu" -W

El ldif de infomed le hice algunos cambios dn: ou=users, dc=casa,dc=cfg,dc=cu ou: users description: All people in organisation objectclass: organizationalunit dn: ou=infomed,ou=users,dc=casa,dc=cfg,dc=cu ou: infomed description: All people in organisation objectclass: organizationalunit

dn: uid=username,ou=infomed,ou=users,dc=casa,dc=cfg,dc=cu sn: eeeeee givenName: Usuario mail: [email protected] uid: username homeDirectory: /srv/vmail/u/usua objectClass: inetOrgPerson objectClass: top objectClass: posixAccount objectClass: sldMailRecipient objectClass: sldPerson objectClass: radiusprofile sldMailbox: /srv/vmail/u/usua uidNumber: 25701 gidNumber: 101 cn: ddddddd homePhone: 999999 sldCI: 00000000000 sldMailQuota: 10 userPassword: eee324234234 mailHost: vmail-part?.red.sld.cu #radiusProfileDn: cn=users.ppp,ou=profiles,ou=radius,ou=services,dc=sld,dc=cu #radiusCallingStationId: 999999 Para adicionar de pone

ldapadd -c -x -D "cn=admin,dc=casa,dc=cfg,dc=cu" -W -f /root/ejemplo.ldiff

la -x es para que sea autenticacin sencilla, no segura, Luego

ldapsearch -x -LL -b "dc=casa,dc=cfg,dc=cu" -D "cn=admin,dc=casa,dc=cfg,dc=cu" -W

devuelve version: 1 dn: dc=casa,dc=cfg,dc=cu objectClass: top objectClass: dcObject objectClass: organization o: casa.cfg.cu dc: casa dn: cn=admin,dc=casa,dc=cfg,dc=cu objectClass: simpleSecurityObject objectClass: organizationalRole cn: admin description: LDAP administrator userPassword:: e2NyeXB0fUhtUVhSdmFpVUFsRlk=

dn: ou=people,dc=casa,dc=cfg,dc=cu ou: people description: All people in organisation objectClass: organizationalUnit dn: cn=John Smith,ou=people,dc=casa,dc=cfg,dc=cu objectClass: inetOrgPerson cn: John Smith cn: John J Smith sn: Smith uid: jsmith userPassword:: alNtaXRI carLicense: HISCAR 124 homePhone: 555-111-2223 mail: [email protected] mail: [email protected] mail: [email protected] ou: Sales dn: ou=users,dc=casa,dc=cfg,dc=cu ou: users description: All people in organisation objectClass: organizationalUnit dn: ou=infomed,ou=users,dc=casa,dc=cfg,dc=cu ou: infomed description: All people in organisation objectClass: organizationalUnit dn: uid=username,ou=infomed,ou=users,dc=casa,dc=cfg,dc=cu sn: eeeeee givenName: Usuario mail: [email protected] uid: username objectClass: inetOrgPerson objectClass: top objectClass: sldMailRecipient objectClass: sldPerson objectClass: radiusprofile sldMailbox: /srv/vmail/u/usua cn: ddddddd homePhone: 999999 sldCI: 00000000000 sldMailQuota: 10 userPassword:: ZWVlMzI0MjM0MjM0 mailHost: vmail-part?.red.sld.cu Borrar una entrada

ldapdelete -x -D "cn=admin,dc=casa,dc=cfg,dc=cu" -w eaf3074 "uid=username,ou=infomed,ou=users,dc=casa,dc=cfg,dc=cu"

You might also like