next up previous contents
Next: 安全機制 Up: OPENLDAP 網路用戶帳號 Previous: LDAP Client 端設定   Contents

LDAP 帳號管理

  1. 產生帳號 ldif 檔
    [root@ildap ~]# vim ldapuser1.ldif
    dn: uid=ldapuser1,ou=People,dc=deyu,dc=wang
    sn: ldapuser1
    uid: ldapuser1
    mail:ldapuser1@csie.cyut.edu.tw
    o: 資工系
    cn: ldapuser1
    objectClass: inetOrgPerson
    objectClass: posixAccount
    objectClass: top
    userPassword: {SSHA}HAvRpYe5TR88asauGqYtoCFzT7qHYqjP
    loginShell: /bin/bash
    uidNumber: 1001
    gidNumber: 1001
    homeDirectory: /home/guests/ldapuser1
    
  2. 加入帳號
    [root@ildap ~]# ldapadd -x -D "cn=Manager,dc=deyu,dc=wang" -w secretpassword -f ldapuser1.ldif
    
  3. 改變帳號密碼
    [root@ildap ~]# ldappasswd -s newpassword -D "cn=Manager, dc=deyu,dc=wang" -W -x "uid=ldpauser1,ou=People,dc=deyu,dc=wang"
    
  4. 刪除帳號
    [root@ildap ~]# ldapdelete -D "cn=Manager, dc=deyu,dc=wang" -W "uid=ldapuser1,ou=People,dc=deyu,dc=wang"
    



2015-04-13