Linux command
slapd 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Start slapd
sudo slapd
Start with a specific configuration file
sudo slapd -f [/etc/openldap/slapd.conf]
Start with debug output
sudo slapd -d [1]
Listen on specific URLs
sudo slapd -h "ldap://127.0.0.1:389/ ldaps:///"
Run in tool mode
slapd -T cat
Display version information
slapd -VV
Test configuration
slapd -T test
说明
slapd is the Stand-alone LDAP Daemon, the core server component of OpenLDAP. It listens for LDAP connections on configured ports (default 389 for LDAP, 636 for LDAPS) and responds to LDAP operations such as bind, search, add, modify, and delete. slapd supports multiple backends for data storage (including MDB, HDB, BDB, and LDAP proxy), overlays for extending functionality (like access logging, password policies, and replication), and various authentication mechanisms including SASL. Configuration can be provided via the traditional slapd.conf file or the newer cn=config LDAP-based configuration in slapd.d/. The daemon typically starts at boot and runs as a background service.
参数
- -f _config-file_
- Specify the slapd configuration file. Default: /etc/openldap/slapd.conf.
- -F _config-dir_
- Specify the slapd configuration directory. Default: /etc/openldap/slapd.d.
- -d _debug-level_
- Enable debugging. slapd will not fork and remains attached to the terminal. Debug level is a bit string where each bit enables different debugging information.
- -h _URLs_
- Specify LDAP URLs to listen on. Examples: ldap://, ldaps://, ldapi:/// for LDAP over IPC.
- -4
- Listen on IPv4 addresses only.
- -6
- Listen on IPv6 addresses only.
- -T _tool_
- Run in tool mode. Tools: add (slapadd), cat (slapcat), dn (slapdn), index (slapindex), modify (slapmodify), passwd (slappasswd), schema (slapschema), test (slaptest).
- -VV[V]
- Print version information. -VV prints and exits. -VVV includes static overlays and backends info.
- -u
- Run as a specific user.
- -g
- Run as a specific group.
- -r _directory_
- Chroot to the specified directory.
- -n _service-name_
- Specify the service name for logging.
FAQ
What is the slapd command used for?
slapd is the Stand-alone LDAP Daemon, the core server component of OpenLDAP. It listens for LDAP connections on configured ports (default 389 for LDAP, 636 for LDAPS) and responds to LDAP operations such as bind, search, add, modify, and delete. slapd supports multiple backends for data storage (including MDB, HDB, BDB, and LDAP proxy), overlays for extending functionality (like access logging, password policies, and replication), and various authentication mechanisms including SASL. Configuration can be provided via the traditional slapd.conf file or the newer cn=config LDAP-based configuration in slapd.d/. The daemon typically starts at boot and runs as a background service.
How do I run a basic slapd example?
Run `sudo slapd` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -f _config-file_ do in slapd?
Specify the slapd configuration file. Default: /etc/openldap/slapd.conf.