How can you view what roots are available in a Uni

2020-05-02 03:24发布

I'm trying to view all root names on a server that are available for searching thru/modifying. I've tried looking online-but I'm still unable to find the base levels. ldapsearch -b "o=blah.com" -p 1111 "objectclass=*" returns everything in that blah.com due to the filter being all object classes. Is there a similar function to be able to find all o=*? I need to able to search thru each of those directories and modify things at some point...and without knowing what's in there, i'm sort of at the mercy of the other developers....

标签: unix ldap
1条回答
叼着烟拽天下
2楼-- · 2020-05-02 04:10

If the question is "How to get valid top-level base dn(s) ?", you have multiple options :

  • Domain components (dc) usually match the FQDN, it makes sense to use these dc's to build up a top level base dn (e.g. 'host.example.com' would give 'dc=example,dc=com'), but it is not guaranteed it results in a valid base dn.
  • Search for rootDSE information :ldapsearch -H ldap://host.example.com -x -s base -b '' +
    Then retrieve the namingContexts or defaultNamingContext attribute(s), any one of them can be used as a search base dn.
  • Use an LDAP explorer like Apache Directory Studio to display the directory tree, select a top object matching objectClass: dcObject (and optionnally o=something) : any corresponding entry can be used as a search base object by using its dn as the base dn.
查看更多
登录 后发表回答