|
NAMEldapsh - an interactive LDAP shellSYNOPSISldapsh [--help] [-D <dn>] [--source <source>] [--uid <uid>] [--base <search base>] [--password <password>] [--server <server>] [--debug <debug level>]DESCRIPTIONldapsh is an interactive LDAP shell, written entirely in perl and using Net::LDAP. It's extensible in that it is relatively easy to add new commands to it. It is largely modeled after the Unix shell, but does not at this point allow multiple tokens through a mechanism like pipes.OPTIONS
Example ldapsh --server ldap.domain.com -D uid=me,ou=People,dc=domain,dc=com password: default:dc=madstop,dc=com> ls ou=People ou=Hosts ou=Group ou=Config default:dc=madstop,dc=com> cd ou=people default:ou=People,dc=madstop,dc=com> ls uid=luke uid=hostmaster uid=testing uid=admin default:ou=People,dc=madstop,dc=com> ls -l Creator Created Modifier Modified Sub Name ------------------------------------------------------------------------ cn=Manager 05/06/2004 21:47:58 - 05/06/2004 21:47:58 - uid=luke uid=luke 07/21/2004 11:36:29 - 07/21/2004 11:40:57 - uid=hostmaster uid=luke 07/26/2004 21:57:39 - 07/29/2004 16:03:19 - uid=testing uid=luke 07/26/2004 23:59:14 - 07/26/2004 23:59:14 - uid=admin default:ou=People,dc=madstop,dc=com> cat uid=luke dn: uid=luke,ou=People,dc=madstop,dc=com objectClass: top objectClass: inetOrgPerson uid: luke cn: Luke Kanies sn: Kanies default:dc=madstop,dc=com> edit uid=luke [...] default:dc=madstop,dc=com> cd .. default:dc=madstop,dc=com> search objectclass=iphost cn=host,ou=Hosts,dc=madstop,dc=com cn=host2,ou=Hosts,dc=madstop,dc=com cn=host3,ou=Hosts,dc=madstop,dc=com cn=host4,ou=Hosts,dc=madstop,dc=com cn=host5,ou=Hosts,dc=madstop,dc=com cn=host6,ou=Hosts,dc=madstop,dc=com cn=host7,ou=Hosts,dc=madstop,dc=com cn=host8,ou=Hosts,dc=madstop,dc=com cn=host9,ou=Hosts,dc=madstop,dc=com default:dc=madstop,dc=com> USING ITldapsh was modeled as closely as possible after a normal Unix shell. It currently supports ReadLine (meaning command editing) but without command completion just yet. RSN, hopefully.Just like the normal shell, it has two classes of commands: builtin commands and commands found via a search path. Builtin commands can be listed by running 'builtins' at the ldapsh prompt. Non-builtin commands are currently only listed in the COMMANDS file included in this distribution, but hopefully that will be fixed soon. Unlike the normal shell, there is not a real parser just yet, which means you can't do things like set variables on the CLI. This is likely to be one of the features in 2.0, with the main other one being command completion. Feature requests are welcome. CONFIGURATIONldapsh relies on the Net::LDAP::Config library, which is useful for configuring one or more LDAP sources. You can use it to store the server name(s), base DNs, whether or not to use SSL, and a few other things. ldapsh searches for its config at /etc/ldapsh_config, /usr/local/etc/ldapsh_config, and ~/.ldapsh_profile.An example is included with the distribution, but here's another: [primary] servers: ldap.domain.com ldap2.domain.com base: dc=domain,dc=com ssl: prefer [external] servers: ldap.otherdomain.com base: dc=otherdomain,dc=com ssl: require [main] default: primary head1 ENVIRONMENT VARIABLES
EXTENDINGIf you want to add your own commands, you can use the stub.pm file as an example. Please send me any commands you add, and I'll include them in the distribution.TODOAdd completion support. I'm working on this, but I just can't get it to work... Help is appreciated. Everything is theoretically set up correctly, but tabs just don't do anything.Create a real parser using YAPP et all, so that I can add things like variable storage and stuff like that. Write better documentation. BUGSThousands, millions. Oh my god this has so many bugs I don't even think I can count that high. Because of my lack of counting ability, I need each and every one of you to spend some time tracking down some of these bugs, so that I can begin figuring out exactly how many there are.Oh, and I'll try to fix them too. SEE ALSONet::LDAP, Net::LDAP::Shell, Net::LDAP::Config, ldapsh_configAUTHORLuke A. Kanies, luke@madstop.com$Id: ldapsh,v 1.4 2004/07/26 22:33:08 luke Exp $
Visit the GSP FreeBSD Man Page Interface. |