2024년 5월 30일 목요일

[LDAP]_LDAP 명령어

 

Ldap 명령어
 # ldapsearch -x -D 'cn=vmail,dc=xxxx,dc=xx' -H 'ldap://xx.xx.xx.xx:389' -W -b 'o=domains,dc=xxxx,dc=xx' '(domainName=*)'
 -D 'cn=.....' : 조회를 위한 사용자 정보
 -H 'ldap....' : 로그인 서버 정보
 -b 'o=domains,dc=xxxx,dc=xx' '(domainName=*)'   : 조회시작지점과 조회 조건


Enter LDAP Password:
# extended LDIF
#
# LDAPv3
# base <o=domains,dc=qnct,dc=cn> with scope subtree
# filter: (domainName=*)
# requesting: ALL
#

# xxxx.xx, domains, xxxx.xx
dn: domainName=xxxx.xx,o=domains,dc=xxxx,dc=xx
objectClass: mailDomain
domainName: xxxx.xx
mtaTransport: dovecot
accountSetting: minPasswordLength:8
accountSetting: defaultQuota:1024
enabledService: mail
cn: xxxxxxxxxxxxxxxxxxxxxxxx
accountStatus: active
domainCurrentUserNumber: 194
domainCurrentQuotaSize: 1887436800

# xxx.xxx, domains, xxxx.xx
dn: domainName=xxx.xxx,o=domains,dc=xxxx,dc=xx
objectClass: mailDomain
domainName: xxx.xxx
mtaTransport: dovecot
enabledService: mail
accountSetting: minPasswordLength:8
cn: xxxxxxxx
accountStatus: active
domainCurrentUserNumber: xxx
domainCurrentQuotaSize: 1153433600

# search result
search: 2
result: 0 Success

# numResponses: 3
# numEntries: 2


* LDAP로 항목 추가하기(빨간색이 입력하는 내용임)

# ldapmodify -a -D cn=Manager,dc=xxxx,dc=xx -W -H ldap://xxx.xxx.xxx.xxx:389 -x
Enter LDAP Password: xxxxxxxxxx
dn: mail=xxxx@xxxx.xxx,ou=Users,domainName=xxxx.xxx,o=domains,dc=xxxx,dc=xxx
changetype: modify
add: mailForwardingAddress
mailForwardingAddress: xxxx@xxxx.xxx

<--엔터를 쳐야 modify 메세지가 보임
modifying entry "mail=xxxx@xxxx.xxx,ou=Users,domainName=xxxx.xxx,o=domains,dc=xxxx,dc=xxx"





댓글 없음:

댓글 쓰기