Skip to content

Jimmy01240397/LDAPUserTools

Repository files navigation

LDAPUserTools

OpenLDAP User Tools.

install

  1. clone this repo and cd into LDAPUserTools.
git clone https://github.com/Jimmy01240397/LDAPUserTools
cd LDAPUserTools
  1. run install.sh
sh install.sh
  1. setup all schema
bash initldapschema.sh <your DC> <olcDatabase file>
  1. setup all ou
slapadd -b <dc> -l base.ldif

Setup ldap ssh public key login in client

cp sshldappubkey.sh /usr/local/bin/sshldappubkey
chmod 700 /usr/local/bin/sshldappubkey
vi /etc/ssh/sshd_config
AuthorizedKeysCommand /usr/local/bin/sshldappubkey
AuthorizedKeysCommandUser root

usage

use -h to see info

ldapuseradd -h
ldapgroupadd -h
ldapusermod -h
ldapgroupmod -h
ldapuserdel -h
ldapgroupdel -h

example

Add group and user

ldapgroupadd -D "cn=admin,dc=example,dc=com" -w "test1234" groupname
ldapuseradd -D "cn=admin,dc=example,dc=com" -w "test1234" -s /bin/bash username

or add a bindconf

vi <pathofbindconf>/<nameofbindconf>.yaml
url: ldap://127.0.0.1
binddn: cn=admin,dc=example,dc=com
bindpasswd: test1234
ldapgroupadd -f <pathofbindconf>/<nameofbindconf>.yaml groupname
ldapuseradd -f <pathofbindconf>/<nameofbindconf>.yaml -s /bin/bash username

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages