App-LDAP
view release on metacpan or search on metacpan
Of course, you can use the most basic way. Download it, unpack it, then build it as per the usual:
$ perl Makefile.PL
$ make && make test
Then install it:
$ make install
## DOCUMENTATION
App::LDAP documentation is available as in POD. So you can do:
$ perldoc App::LDAP
to read the documentation online with your favorite pager.
## USAGE
Assume your base is `dc=example,dc=com` which has been set up in `/etc/ldap/ldap.conf` or a acceptable place. and there
are also some Organizational Units has been set up for *nss* and *pam* modules as following.
+ ou=people,dc=example,dc=com
+ ou=groups,dc=example,dc=com
+ ou=hosts,dc=exampke,dc=com
+ ou=sudoers,dc=example,dc=com
### initialize
App::LDAP also requires some third-party schemas to function. These schemas are shipped with the project in the folder
`schema/`. You can import them into the LDAP server via `$ ldapadd -Y EXTERNAL -I LDAPI:/// -f filename.ldif` or let
App::LDAP do it for you even better.
$ sudo ldap init # configure server to load schema/* at runtime
### add
After accomplishing all prerequisites, The schemas have been supported in `App::LDAP::LDIF::*` can be added via command
line.
$ sudo ldap add user shelling # add posixAccount uid=shelling,ou=people,dc=example,dc=com
$ sudo ldap add group maintainer # add posixGroup cn=maintainer,ou=groups,dc=example,dc=com
$ sudo ldap add sudoer shelling # add sudoer cn=shelling,ou=sudoers,dc=example,dc=com
$ sudo ldap add host dns # add host cn=dns,ou=hosts,dc=example,dc=com
$ sudo ldap add ou test # add organizational unit ou=test,dc=example,dc=com
### delete
Every schema is also supported to be deleted from command line.
$ sudo ldap del user shelling # delete posixAccount uid=shelling,ou=people,dc=example,dc=com
$ sudo ldap del group maintainer # delete posixGroup cn=maintainer,dc=groups,dc=example,dc=com
### password
App::LDAP can guess your role from your UID, and help you to change your password.
$ ldap passwd # change password of yourself
$ sudo ldap passwd shelling # using priviledge of ldap admin to change passwd of shelling
$ sudo ldap passwd shelling --lock # lock shelling
$ sudo ldap passwd shelling --unlock # unlock shelling
### backup and restoring
Doing backup and restoring are also supported.
$ sudo ldap import new.ldif # add content of new.ldif
$ sudo ldap export all.ldif # save all entries under dc=example,dc=com into all.ldif
## LICENSE
Copyright (C) 2010 shelling
MIT (X11) License
( run in 0.549 second using v1.01-cache-2.11-cpan-39bf76dae61 )