{{tag>[LDAP]}} ====== ldapsearch ====== ===== USAGE ===== ldapsearch [options] [filter [attributes...]] ldapsearch -x -W -D 'cn=Manager,dc=zerotymer,dc=net' -b "" -s base -H ldap://localhost * ''**ldapsearch** [options] filter attribute'' * ''**options**'' * ''**-b** DN'': base on DN * ''**-f** FILE'': 검색 필터를 파일에서 불러오기 * ''**-s** SCOPE'': 검색 범위 지정. (sub | one | base) * ''**-D** DN'': bind DN(지정된 사용자 자격증명으로 바인딩) * ''**-w** password'': 비밀번호 입력 * ''**-W**'': 비밀번호 입력 프롬프트 * ''**-h** HOST'': LDAP HOST * ''**-p** PORT'': LDAP PORT * ''**-H** URI'': LDAP URI (ldap://localhost * ''**-x**'': Simple authentication * ''**-f** FILE'': 파일에서 비밀번호 불러오기 * ''**-L**'': 출력 표기 형식(default) ++ overloads || \\ ''**-LL**'' \\ ''**-LLL**'' ++ * ''**filter**'' * ''**attribute**'' 표기 대상 어트리뷰트 ==== filter ==== * ''"(objectclass=*)"'' 모든 항목 검색 * ''"(cn=babs jensen)"'': 특정 이름 검색 * ''"(&(objectclass=person)(|sn=Jensen)(cn=Babs J*)))"'': 복합 필터 사용 ===== HELP ===== ++++ ldapsearch | usage: ldapdelete [options] [dn]... dn: list of DNs to delete. If not given, it will be read from stdin or from the file specified with "-f file". Delete Options: -c continuous operation mode (do not stop on errors) -f file read operations from `file' -M enable Manage DSA IT control (-MM to make critical) [root@remote-dev ~]# ll 합계 24 -rw-------. 1 root root 1295 1월 7 11:40 anaconda-ks.cfg -rw-r--r-- 1 root root 385 1월 13 23:14 basedomain.ldif -rw-r--r-- 1 root root 886 1월 13 23:13 chdomain.ldif -rw-r--r-- 1 root root 120 1월 13 23:10 chrootpw.ldif -rw-r--r-- 1 root root 232 1월 13 21:40 db.ldif -rw-r--r-- 1 root root 152 1월 13 21:42 ou.ldif [root@remote-dev ~]# ldapsearch --help ldapsearch: invalid option -- '-' ldapsearch: unrecognized option -- usage: ldapsearch [options] [filter [attributes...]] where: filter RFC 4515 compliant LDAP search filter attributes whitespace-separated list of attribute descriptions which may include: 1.1 no attributes * all user attributes + all operational attributes Search options: -a deref one of never (default), always, search, or find -A retrieve attribute names only (no values) -b basedn base dn for search -c continuous operation mode (do not stop on errors) -E [!][=] search extensions (! indicates criticality) [!]accountUsability (NetScape Account usability) [!]domainScope (domain scope) !dontUseCopy (Don't Use Copy) [!]mv= (RFC 3876 matched values filter) [!]pr=[/prompt|noprompt] (RFC 2696 paged results/prompt) [!]ps=// (draft persistent search) [!]sss=[-][/[-]...] (RFC 2891 server side sorting) [!]subentries[=true|false] (RFC 3672 subentries) [!]sync=ro[/] (RFC 4533 LDAP Sync refreshOnly) rp[/][/] (refreshAndPersist) [!]vlv=/(//|:) (ldapv3-vlv-09 virtual list views) [!]deref=derefAttr:attr[,...][;derefAttr:attr[,...][;...]] !dirSync=/[/] (MS AD DirSync) [!]extendedDn= (MS AD Extended DN [!]showDeleted (MS AD Show Deleted) [!]serverNotif (MS AD Server Notification) [!][=:|::] (generic control; no response handling) -f file read operations from `file' -F prefix URL prefix for files (default: file:///tmp/) -l limit time limit (in seconds, or "none" or "max") for search -L print responses in LDIFv1 format -LL print responses in LDIF format without comments -LLL print responses in LDIF format without comments and version -M enable Manage DSA IT control (-MM to make critical) -P version protocol version (default: 3) -s scope one of base, one, sub or children (search scope) -S attr sort the results by attribute `attr' -t write binary values to files in temporary directory -tt write all values to files in temporary directory -T path write files to directory specified by path (default: /tmp) -u include User Friendly entry names in the output -z limit size limit (in entries, or "none" or "max") for search Common options: -d level set LDAP debugging level to `level' -D binddn bind DN -e [!][=] general extensions (! indicates criticality) [!]assert= (RFC 4528; a RFC 4515 Filter string) [!]authzid= (RFC 4370; "dn:" or "u:") [!]bauthzid (RFC 3829) [!]chaining[=[/]] one of "chainingPreferred", "chainingRequired", "referralsPreferred", "referralsRequired" [!]manageDSAit (RFC 3296) [!]noop ppolicy [!]postread[=] (RFC 4527; comma-separated attr list) [!]preread[=] (RFC 4527; comma-separated attr list) [!]relax [!]sessiontracking[=] abandon, cancel, ignore (SIGINT sends abandon/cancel, or ignores response; if critical, doesn't wait for SIGINT. not really controls) -h host LDAP server (deprecated in favor of "-H") -H URI LDAP Uniform Resource Identifier(s) -I use SASL Interactive mode -n show what would be done but don't actually do it -N do not use reverse DNS to canonicalize SASL host name -O props SASL security properties -o [=] any libldap ldap.conf options, plus ldif_wrap= (in columns, or "no" for no wrapping) nettimeout= (in seconds, or "none" or "max") -p port port on LDAP server (deprecated in favor of "-H") -Q use SASL Quiet mode -R realm SASL realm -U authcid SASL authentication identity -v run in verbose mode (diagnostics to standard output) -V print version info (-VV only) -w passwd bind password (for simple authentication) -W prompt for bind password -x Simple authentication -X authzid SASL authorization identity ("dn:" or "u:") -y file Read password from file -Y mech SASL mechanism -Z Start TLS request (-ZZ to require successful response) ++++