Advertisement
vossen

ldif commands on 389

Jun 28th, 2019
3,312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LDIF 3.34 KB | None | 0 0
  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. givenName: Red
  48. sn: Dragon
  49. eduPersonAffiliation: FACEMP
  50. eduPersonAffiliation: EMERET
  51.  
  52. # bdragon, People, seaofcarag.com
  53. dn: uid=bdragon,ou=People,dc=seaofcarag,dc=com
  54. changetype: add
  55. objectClass: top
  56. objectClass: nsPerson
  57. objectClass: nsAccount
  58. objectClass: nsOrgPerson
  59. objectClass: posixAccount
  60. objectClass: nsMemberOf
  61. objectClass: inetOrgPerson
  62. objectClass: organizationalPerson
  63. objectClass: person
  64. objectClass: eduPerson
  65. uid: bdragon
  66. cn: Black Dragon
  67. displayName: Black Dragon
  68. uidNumber: 85111123
  69. gidNumber: 85123123
  70. homeDirectory: /home/bdragon
  71. memberOf:
  72. givenName: Black
  73. sn: Dragon
  74. eduPersonAffiliation: FACEMP
  75.  
  76. # pdragon, People, seaofcarag.com
  77. dn: uid=pdragon,ou=People,dc=seaofcarag,dc=com
  78. changetype: add
  79. objectClass: top
  80. objectClass: nsPerson
  81. objectClass: nsAccount
  82. objectClass: nsOrgPerson
  83. objectClass: posixAccount
  84. objectClass: nsMemberOf
  85. objectClass: inetOrgPerson
  86. objectClass: organizationalPerson
  87. objectClass: person
  88. objectClass: eduPerson
  89. givenName: Purple
  90. sn: Dragon
  91. eduPersonAffiliation: FACEMP
  92. eduPersonAffiliation: EMERET
  93. uid: pdragon
  94. cn: Purple Dragon
  95. displayName: Purple Dragon
  96. uidNumber: 1243654
  97. gidNumber: 8255233
  98. homeDirectory: /home/pdragon
  99.  
  100. Add to group:
  101. dn: cn=Dragon's Nest,ou=Groups,dc=seaofcarag,dc=com
  102. changetype: modify
  103. add: uniqueMember
  104. uniqueMember: uid=gdragon,ou=People,dc=seaofcarag,dc=com
  105.  
  106. Remove from group:
  107. dn: cn=Dragon's Nest,ou=Groups,dc=seaofcarag,dc=com
  108. changetype: modify
  109. delete: uniqueMember
  110. uniqueMember: uid=gdragon,ou=People,dc=seaofcarag,dc=com
  111.  
  112. Add multiples to group:
  113. dn: cn=Dragon's Nest,ou=Groups,dc=seaofcarag,dc=com
  114. changetype: modify
  115. add: uniqueMember
  116. uniqueMember: uid=bdragon,ou=People,dc=seaofcarag,dc=com
  117.  
  118. dn: cn=Caragian Caves,ou=Groups,dc=seaofcarag,dc=com
  119. changetype: modify
  120. add: member
  121. member: uid=bdragon,ou=People,dc=seaofcarag,dc=com
  122.  
  123. dn: cn=Caragian Caves,ou=Groups,dc=seaofcarag,dc=com
  124. changetype: modify
  125. delete: member
  126. member: uid=g=bdragon,ou=People,dc=seaofcarag,dc=com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement