vossen

ldif commands on 389

Jun 28th, 2019
526
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Random helpful commands:
  2. ldapmodify -D "cn=Directory Manager" -w secret
  3. ldapsearch -D "cn=Directory Manager" -w secret 'uid=*'
  4. ldapsearch -D "cn=Directory Manager" -w secret 'objectClass=group*'
  5. ldapsearch -D "cn=Directory Manager" -w secret' (&(|(objectClass=groupOfUniqueNames)(objectClass=groupOfNames))(cn=Dragon\'s Nest))'
  6.  
  7. Place updates in mod.ldif:
  8. ldapmodify -D "cn=Directory Manager" -w secret -f mod.ldif
  9.  
  10. LDIFS - put into mod.ldif
  11. Create Groups:
  12. dn: cn=Dragon Nest,ou=Groups,dc=seaofcarag,dc=com
  13. changetype: add
  14. objectClass: top
  15. objectClass: groupOfUniqueNames
  16. objectClass: nsMemberOf
  17. cn: Dragon Nest
  18.  
  19. dn: cn=Caragian Caves,ou=Groups,dc=seaofcarag,dc=com
  20. changetype: add
  21. objectClass: top
  22. objectClass: groupOfNames
  23. objectClass: nsMemberOf
  24. cn: Caragian Caves
  25.  
  26. Create Users
  27. # rdragon, People, seaofcarag.com
  28. dn: uid=rdragon,ou=People,dc=seaofcarag,dc=com
  29. changetype: add
  30. objectClass: top
  31. objectClass: nsPerson
  32. objectClass: nsAccount
  33. objectClass: nsOrgPerson
  34. objectClass: posixAccount
  35. objectClass: nsMemberOf
  36. objectClass: inetOrgPerson
  37. objectClass: organizationalPerson
  38. objectClass: person
  39. objectClass: eduPerson
  40. uid: rdragon
  41. cn: Red Dragon
  42. displayName: Red Dragon
  43. uidNumber: 8511291
  44. gidNumber: 8512196
  45. homeDirectory: /home/rdragon
  46. memberOf:
  47. mail: rdragon@389.seaofcarag.com
  48. givenName: Red
  49. sn: Dragon
  50. eduPersonAffiliation: FACEMP
  51. eduPersonAffiliation: EMERET
  52.  
  53. # bdragon, People, seaofcarag.com
  54. dn: uid=bdragon,ou=People,dc=seaofcarag,dc=com
  55. changetype: add
  56. objectClass: top
  57. objectClass: nsPerson
  58. objectClass: nsAccount
  59. objectClass: nsOrgPerson
  60. objectClass: posixAccount
  61. objectClass: nsMemberOf
  62. objectClass: inetOrgPerson
  63. objectClass: organizationalPerson
  64. objectClass: person
  65. objectClass: eduPerson
  66. uid: bdragon
  67. cn: Black Dragon
  68. displayName: Black Dragon
  69. uidNumber: 85111123
  70. gidNumber: 85123123
  71. homeDirectory: /home/bdragon
  72. memberOf:
  73. mail: bdragon@389.seaofcarag.com
  74. givenName: Black
  75. sn: Dragon
  76. eduPersonAffiliation: FACEMP
  77.  
  78. # pdragon, People, seaofcarag.com
  79. dn: uid=pdragon,ou=People,dc=seaofcarag,dc=com
  80. changetype: add
  81. objectClass: top
  82. objectClass: nsPerson
  83. objectClass: nsAccount
  84. objectClass: nsOrgPerson
  85. objectClass: posixAccount
  86. objectClass: nsMemberOf
  87. objectClass: inetOrgPerson
  88. objectClass: organizationalPerson
  89. objectClass: person
  90. objectClass: eduPerson
  91. mail: pdragon@389.seaofcarag.com
  92. givenName: Purple
  93. sn: Dragon
  94. eduPersonAffiliation: FACEMP
  95. eduPersonAffiliation: EMERET
  96. uid: pdragon
  97. cn: Purple Dragon
  98. displayName: Purple Dragon
  99. uidNumber: 1243654
  100. gidNumber: 8255233
  101. homeDirectory: /home/pdragon
  102.  
  103. Add to group:
  104. dn: cn=Dragon's Nest,ou=Groups,dc=seaofcarag,dc=com
  105. changetype: modify
  106. add: uniqueMember
  107. uniqueMember: uid=gdragon,ou=People,dc=seaofcarag,dc=com
  108.  
  109. Remove from group:
  110. dn: cn=Dragon's Nest,ou=Groups,dc=seaofcarag,dc=com
  111. changetype: modify
  112. delete: uniqueMember
  113. uniqueMember: uid=gdragon,ou=People,dc=seaofcarag,dc=com
  114.  
  115. Add multiples to group:
  116. dn: cn=Dragon's Nest,ou=Groups,dc=seaofcarag,dc=com
  117. changetype: modify
  118. add: uniqueMember
  119. uniqueMember: uid=bdragon,ou=People,dc=seaofcarag,dc=com
  120.  
  121. dn: cn=Caragian Caves,ou=Groups,dc=seaofcarag,dc=com
  122. changetype: modify
  123. add: member
  124. member: uid=bdragon,ou=People,dc=seaofcarag,dc=com
  125.  
  126. dn: cn=Caragian Caves,ou=Groups,dc=seaofcarag,dc=com
  127. changetype: modify
  128. delete: member
  129. member: uid=g=bdragon,ou=People,dc=seaofcarag,dc=com
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×