sudo requires setting up the command configuration on the IPA server and then configuring the local sudo client to look for the appropriate configuration.
sudo bind user.
$ export LDAPTLS_CACERT=/etc/ipa/ca.crt
sudo user, uid=sudo,cn=sysaccounts,cn=etc,dc=example,dc=com:
$ ldappasswd -x -S -W -h ipaserver.ipadocs.org -ZZ -D "cn=Directory Manager" uid=sudo,cn=sysaccounts,cn=etc,dc=example,dc=com
New password:
Re-enter new password:
Enter LDAP Password:sudo to look to LDAP for the sudoers file.
vim /etc/nsswitch.conf sudoers: files ldap
files option in place allows sudo to check its local configuration before checking the LDAP-based IPA configuration.
sudo operations in the /etc/ldap.conf file. If this file does not exist, it can be created.
vim /etc/ldap.conf++sudoers_debug: 1
sudoers_debug parameter helps with troubleshooting. Valid values for this parameter are 0, 1, and 2. The sudo documentation at http://www.gratisoft.us/sudo/readme_ldap.html has more information on debugging the process.
ipa_server entry in the /etc/sssd/sssd.conf file:
ldap_netgroup_search_base = cn=ng,cn=compat,dc=example,dc=com
# service sssd restart
sudo-related lines to the /etc/nslcd.conf file:
binddn uid=sudo,cn=sysaccounts,cn=etc,dc=example,dc=com
bindpw sudo_password
ssl start_tls
tls_cacertfile /etc/ipa/ca.crt
tls_checkpeer yes
bind_timelimit 5
timelimit 15
uri ldap://ipaserver.example.com ldap://backup.example.com:3890
sudoers_base ou=SUDOers,dc=example,dc=com
sudo LDAP configuration is covered in the sudo manpages, http://www.sudo.ws/sudo/man/1.8.2/sudoers.ldap.man.html.
uri directive must give the fully-qualified domain name of the LDAP server, not an IP address. Otherwise, sudo fails to connect to the LDAP server.
/etc/nslcd.conf file is created by the nss-pam-ldapd package. However, if nss-pam-ldapd is not installed, then the /etc/nslcd.conf file can be created manually and the sudo configuration works fine.
sudo configuration. sudo uses NIS netgroups, so the NIS domain name must be set in the system configuration for sudo to be able to find the host groups used in the IPA sudo configuration:
# nisdomainname example.com
sudo uses NIS-style netgroups, it is not necessary to have a NIS server installed. Netgroups require that a NIS domain be named in their configuration, so sudo requires that a NIS domain be named for netgroups. However, that NIS domain does not actually need to exist.