Linux Domain Identity, Authentication, and Policy Guide
Using Red Hat Identity Management in Linux Environments
Abstract
The System-Level Authentication Guide documents different applications and services available to configure authentication on local systems, including the authconfig utility, the System Security Services Daemon (SSSD) service, the Pluggable Authentication Module (PAM) framework, Kerberos, the certmonger utility, and single sign-on (SSO) for applications.
The Windows Integration Guide documents how to integrate Linux domains with Microsoft Windows Active Directory (AD) using Identity Management. Among other topics, the guide covers various aspects of direct and indirect AD integration, using SSSD to access a Common Internet File System (CIFS), and the realmd system.
Part I. Overview of Red Hat Identity Management
Chapter 1. Introduction to Red Hat Identity Management
1.1. The Goal of Red Hat Identity Management
- Advanced features of Linux operating system environments
- Unifying large groups of Linux machines
- Native integration with Active Directory
- IdM builds on existing, native Linux tools and protocols. It has its own processes and configuration, but its underlying technologies are well-established on Linux systems and trusted by Linux administrators.
- IdM servers and clients are Red Hat Enterprise Linux machines. However, even though IdM does not support Windows clients directly, it allows integration with Active Directory environment.
Note
This guide describes using IdM in Linux environments only. For more information on integration with Active Directory, see the Windows Integration Guide.For information on the Samba suite, which allows integrating Linux machines into Active Directory environment, see the Using Samba, Kerberos, and Winbind chapter in the Windows Integration Guide.
1.1.1. Examples of Benefits Brought by IdM
- Managing identities and policies with several Linux servers
- Without IdM: Each server is administered separately. All passwords are saved on the local machines. The IT administrator manages users on every machine, sets authentication and authorization policies separately, and maintains local passwords.With IdM: The IT administrator can:
- Maintain the identities in one central place: the IdM server
- Apply policies uniformly to multiples of machines at the same time
- Set different access levels for users by using host-based access control, delegation, and other rules
- Centrally manage privilege escalation rules
- Define how home directories are mounted
- Enterprise single sign-on
- Without IdM: Users log in to the system and are prompted for a password every single time they access a service or application. These passwords might be different, and the users have to remember which credential to use for which application.With IdM: After users log in to the system, they can access multiple services and applications without being repeatedly asked for their credentials. This helps:
- Improve usability
- Reduce the security risk of passwords being written down or stored insecurely
- Boost user productivity
- Managing a mixed Linux and Windows environment
- Without IdM: Windows systems are managed in an Active Directory forest, but development, production, and other teams have many Linux systems. The Linux systems are excluded from the Active Directory environment.With IdM: The IT administrator can:
- Manage the Linux systems using native Linux tools
- Integrate the Linux systems with the Windows systems, thus preserving a centralized user store
- Expand the Linux base easily
- Separate management of Linux and Active Directory machines and enable Linux and Windows admins to control their environment directly
1.1.2. Contrasting Identity Management with a Standard LDAP Directory
- Schema: a flexible schema that can be customized for a vast array of entries, such as users, machines, network entities, physical equipment, or buildings.
- Typically used as: a back-end directory to store data for other applications, such as business applications that provide services on the Internet.
- Schema: a specific schema that defines a particular set of entries relevant to its purpose, such as entries for user or machine identities.
- Typically used as: the identity and authentication server to manage identities within the boundaries of an enterprise or a project.
Additional Resources
- Identity Management or Red Hat Directory Server – Which One Should I Use? on the Red Hat Enterprise Linux Blog.
1.2. The Identity Management Domain
- IdM servers, which work as domain controllers
- IdM clients, which are enrolled with the servers
Note
1.2.1. Identity Management Servers
1.2.1.1. Services Hosted by IdM Servers
- Kerberos KDC
- IdM uses the Kerberos protocol to support single sign-on. With Kerberos, the user only needs to present the correct user name and password once. Then the user can access IdM services without the system prompting for the credentials again.
- For details on how Kerberos works, see the System-Level Authentication Guide.
- For information on how to authenticate using Kerberos in IdM, see Section 5.2, “Logging into IdM Using Kerberos”.
- For information on managing Kerberos in IdM, see Chapter 29, Managing the Kerberos Domain.
- LDAP directory server
- IdM includes an internal LDAP directory server instance where it stores all the IdM information, such as information related to Kerberos, user accounts, host entries, services, policies, DNS, and others.The LDAP directory server instance is based on the same technology as Red Hat Directory Server. However, it is tuned to IdM-specific tasks.
Note
This guide refers to this component as Directory Server. - Certificate authority
- In most deployments, an integrated certificate authority (CA) is installed with the IdM server. You can also install the server without the integrated CA if you create and provide all required certificates independently.
- For more details on installing an IdM server with the different CA configurations, see Section 2.3.2, “Determining What CA Configuration to Use”.
Note
This guide refers to this component as Certificate System when addressing the implementation and as certificate authority when addressing the services provided by the implementation.For information relating to Red Hat Certificate System, a standalone Red Hat product, see Product Documentation for Red Hat Certificate System. - Domain Name System (DNS)
- IdM uses DNS for dynamic service discovery. The IdM client installation utility can use information from DNS to automatically configure the client machine. After the client is enrolled in the IdM domain, it uses DNS to locate IdM servers and services within the domain.
- For more information about service discovery, see the System-Level Authentication Guide.
- For information on using DNS with IdM and important prerequisites, see Section 2.1.3, “Host Name and DNS Configuration”.
- For details on installing an IdM server with or without integrated DNS, see Section 2.3.1, “Determining Whether to Use Integrated DNS”.
- Network Time Protocol
- Many services require that servers and clients have the same system time, within a certain variance. For example, Kerberos tickets use time stamps to determine their validity and to prevent replay attacks. If the times between the server and client skew outside the allowed range, the Kerberos tickets are invalidated.By default, IdM uses the Network Time Protocol (NTP) to synchronize clocks over a network. With NTP, a central server acts as an authoritative clock and the clients synchronize their times to match the server clock. The IdM server is configured as the NTP server for the IdM domain during the server installation process.
Note
Running an NTP server on an IdM server installed on a virtual machine can lead to inaccurate time synchronization in some environments. To avoid potential problems, do not run NTP on IdM servers installed on virtual machines. For more information on the reliability of an NTP server on a virtual machine, see this Knowledgebase solution.

Figure 1.1. The Identity Management Server: Unifying Services
1.2.2. Identity Management Clients
1.2.2.1. Services Hosted by IdM Clients
- System Security Services Daemon
- The System Security Services Daemon (SSSD) is a client-side application for caching credentials. Using SSSD on client machines is recommended because it simplifies the required client configuration. SSSD also provides additional features, for example:
- Offline client authentication, ensured by caching credentials from centralized identity and authentication stores locally
- Improved consistency of the authentication process, because it is not necessary to maintain both a central account and a local user account for offline authentication
- Integration with other services, such as
sudo - Host-based access control (HBAC) authorization
With SSSD, the IdM administrators can define all identity configuration centrally in the IdM server. Caching enables the local system to continue normal authentication operations if the IdM server becomes unavailable or if the client becomes offline.For more information about SSSD, see the System-Level Authentication Guide. SSSD also supports Windows Active Directory (AD). For more information about using SSSD with AD, see the Windows Integration Guide. certmonger- The
certmongerservice monitors and renews the certificates on the client. It can request new certificates for the services on the system.For more information aboutcertmonger, see the System-Level Authentication Guide.

Figure 1.2. Interactions Between IdM Services
Part II. Installing Identity Management
Chapter 2. Installing and Uninstalling an Identity Management Server
- Install the necessary packages
- Configure the machine using setup scripts
2.1. Prerequisites for Installing a Server
2.1.1. Hardware Recommendations
- For 10,000 users and 100 groups: at least 3 GB of RAM and 1 GB swap space
- For 100,000 users and 50,000 groups: at least 16 GB of RAM and 4 GB of swap space
Note
2.1.2. System Requirements
/var/lib/ipa/sysrestore/.
- Federal Information Processing Standard (FIPS) support
- In environments set up using Red Hat Enterprise Linux 7.4 and later:
- You can configure a new IdM server, replica, or client on a system with the FIPS mode enabled. The installation script automatically detects a system with FIPS enabled and configures IdM without the administrator's intervention.To enable FIPS in the operating system, see Enabling FIPS Mode in the Security Guide.
Important
You cannot:- Enable FIPS mode on existing IdM servers previously installed with FIPS mode disabled.
- Install a replica in FIPS mode when using an existing IdM server with FIPS mode disabled.
In environments set up using Red Hat Enterprise Linux 7.3 and earlier:- IdM does not support the FIPS mode. Disable FIPS on your system before installing an IdM server, replica, or client, and do not enable it after the installation.
For further details about FIPS mode, see Federal Information Processing Standard (FIPS) in the Security Guide. - Name Service Cache Daemon (NSCD) requirements
- Red Hat recommends to disable NSCD on Identity Management machines. Alternatively, if disabling NSCD is not possible, only enable NSCD for maps that SSSD does not cache.Both NSCD and the SSSD service perform caching, and problems can occur when systems use both services simultaneously. See the System-Level Authentication Guide for information on how to avoid conflicts between NSCD and SSSD.
- IPv6 must be enabled on the system
- Installing and running an IdM server requires IPv6 to be enabled on the network. Note that IPv6 is enabled by default on Red Hat Enterprise Linux 7 systems.If you disabled IPv6 before, re-enable it as described in How do I disable or enable the IPv6 protocol in Red Hat Enterprise Linux? in Red Hat Knowledgebase.
Note
2.1.3. Host Name and DNS Configuration
Warning
- you have a tested and functional DNS service available
- the service is properly configured
Important
Verifying the Server Host Name
server.example.com. To verify your machine's host name, use the hostname utility:
[root@server ~]# hostname server.example.com
hostname must not be localhost or localhost6.
Important
127.0.0.1.
Verifying the Forward and Reverse DNS Configuration
- Obtain the IP address of the server. The
ip addr showcommand displays both the IPv4 and IPv6 addresses:- The IPv4 address is displayed on the line starting with
inet. In the following example, the configured IPv4 address is192.0.2.1. - The IPv6 address is displayed on the line starting with
inet6. Only IPv6 addresses withscope globalare relevant for this procedure. In the following example, the returned IPv6 address is2001:DB8::1111.
[root@server ~]# ip addr show ... 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:1a:4a:10:4e:33 brd ff:ff:ff:ff:ff:ff inet 192.0.2.1/24 brd 192.0.2.255 scope global dynamic eth0 valid_lft 106694sec preferred_lft 106694sec inet6 2001:DB8::1111/32 scope global dynamic valid_lft 2591521sec preferred_lft 604321sec inet6 fe80::56ee:75ff:fe2b:def6/64 scope link valid_lft forever preferred_lft forever
- Verify the forward DNS configuration by using the
digutility and adding the host name.- Run the
dig +short server.example.com Acommand. The returned IPv4 address must match the IP address returned byip addr show:[root@server ~]# dig +short server.example.com A 192.0.2.1
- Run the
dig +short server.example.com AAAAcommand. If the command returns an address, it must match the IPv6 address returned byip addr show:[root@server ~]# dig +short server.example.com AAAA 2001:DB8::1111
Note
If no output is returned for the AAAA record, it does not indicate incorrect configuration; no output only means that no IPv6 address is configured in DNS for the server machine. If you do not intend to use the IPv6 protocol in your network, you can proceed with the installation in this situation.
- Verify the reverse DNS configuration (PTR records) by using the
digutility and adding the IP address.- Run the
dig +short -x IPv4 addresscommand. The server host name must be displayed in the command output. For example:[root@server ~]# dig +short -x 192.0.2.1 server.example.com
- Use
digto query the IPv6 address as well if thedig +short -x server.example.com AAAAcommand in the previous step returned an IPv6 address. Again, the server host name must be displayed in the command output. For example:[root@server ~]# dig +short -x 2001:DB8::1111 server.example.com
Note
Ifdig +short server.example.com AAAAin the previous step did not display any IPv6 address, querying the AAAA record does not output anything. In this case, this is normal behavior and does not indicate incorrect configuration.
If a different host name or no host name is displayed, even thoughdig +short server.example.comin the previous step returned an IP address, it indicates that the reverse DNS configuration is incorrect.
Verifying the Standards-compliance of DNS Forwarders
$ dig +dnssec @IP_address_of_the_DNS_forwarder . SOA
- status:
NOERROR - flags:
ra - EDNS flags:
do - The
RRSIGrecord must be present in theANSWERsection
dnssec-enable yes; option must be set in the /etc/named.conf file.
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48655 ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags: do; udp: 4096 ;; ANSWER SECTION: . 31679 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2015100701 1800 900 604800 86400 . 31679 IN RRSIG SOA 8 0 86400 20151017170000 20151007160000 62530 . GNVz7SQs [...]
The /etc/hosts File
Important
/etc/hosts file manually. If /etc/hosts has been modified, make sure its contents conform to the following rules.
/etc/hosts file. It properly lists the IPv4 and IPv6 localhost entries for the host, followed by the IdM server IP address and host name as the first entry. Note that the IdM server host name cannot be part of the localhost entry.
127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.0.2.1 server.example.com server 2001:DB8::1111 server.example.com server
2.1.4. Port Requirements
- For a list of the required ports, see the section called “List of Required Ports”.
- For a list of
firewalldservices that correspond to the required ports, see the section called “List of firewalld Services”.
List of Required Ports
Table 2.1. Identity Management Ports
| Service | Ports | Protocol |
|---|---|---|
| HTTP/HTTPS | 80, 443 | TCP |
| LDAP/LDAPS | 389, 636 | TCP |
| Kerberos | 88, 464 | TCP and UDP |
| DNS | 53 | TCP and UDP |
| NTP | 123 | UDP |
Note
- Port 80 (HTTP) is used to provide Online Certificate Status Protocol (OCSP) responses and Certificate Revocation Lists (CRL). Both are digitally signed and therefore secured against man-in-the-middle attacks.
- Port 389 (LDAP) uses STARTTLS and GSSAPI for encryption.
List of firewalld Services
Table 2.2. firewalld Services
| Service name | For details, see: |
|---|---|
freeipa-ldap | /usr/lib/firewalld/services/freeipa-ldap.xml |
freeipa-ldaps | /usr/lib/firewalld/services/freeipa-ldaps.xml |
dns | /usr/lib/firewalld/services/dns.xml |
Opening the Required Ports
- Make sure the
firewalldservice is running.- To find out if
firewalldis currently running:# systemctl status firewalld.service
- To start
firewalldand configure it to start automatically when the system boots:# systemctl start firewalld.service # systemctl enable firewalld.service
- Open the required ports using the
firewall-cmdutility. Choose one of the following options:- Add the individual ports to the firewall by using the
firewall-cmd --add-portcommand. For example, to open the ports in the default zone:# firewall-cmd --permanent --add-port={80/tcp,443/tcp,list_of_ports} - Add the
firewalldservices to the firewall by using thefirewall-cmd --add-servicecommand. For example, to open the ports in the default zone:# firewall-cmd --permanent --add-service={freeipa-ldap,list_of_services}
For details on usingfirewall-cmdto open ports on a system, see the Security Guide or the firewall-cmd(1) man page. - Reload the
firewall-cmdconfiguration to ensure that the change takes place immediately:# firewall-cmd --reload
Note that reloadingfirewalldon a system in production can cause DNS connection time outs. See also Reloading the Firewall Using the Command-Line Interface in the Security Guide. If required, to avoid the risk of time outs, repeat the commands without the--permanentoption to apply the changes to the running system. - Optional. To verify that the ports are available now, use the
nc,telnet, ornmaputilities to connect to a port or run a port scan.
Note
2.2. Packages Required to Install an IdM Server
# yum install ipa-server
# yum install ipa-server ipa-server-dns
Note
- 389-ds-base for the Directory Server LDAP service
- krb5-server package for the Kerberos service
- various IdM-specific tools
2.3. Installing an IdM Server: Introduction
Note
ipa-server-install utility installs and configures an IdM server.
ipa-server-install utility provides a non-interactive installation mode which allows automated and unattended server setup. For details, see Section 2.3.7, “Installing a Server Non-Interactively”
ipa-server-install installation script creates a log file at /var/log/ipaserver-install.log. If the installation fails, the log can help you identify the problem.
2.3.1. Determining Whether to Use Integrated DNS
- An IdM server with integrated DNS services
- The integrated DNS server provided by IdM is not designed to be used as a general-purpose DNS server. It only supports features related to IdM deployment and maintenance. It does not support some of the advanced DNS features.Red Hat strongly recommends IdM-integrated DNS for basic usage within the IdM deployment: When the IdM server also manages DNS, there is tight integration between DNS and native IdM tools which enables automating some of the DNS record management.Note that even if an IdM server is used as a master DNS server, other external DNS servers can still be used as slave servers.For example, if your environment is already using another DNS server, such as an Active Directory-integrated DNS server, you can delegate only the IdM primary domain to the IdM-integrated DNS. You are not required to migrate DNS zones over to the IdM-integrated DNS.To install a server with integrated DNS, see Section 2.3.3, “Installing a Server with Integrated DNS”
- An IdM server without integrated DNS services
- An external DNS server is used to provide the DNS services. Consider installing an IdM server without DNS in these situations:
- If you require advanced DNS features beyond the scope of the IdM DNS
- In environments with a well-established DNS infrastructure which allows you to use external DNS servers
To install a server without integrated DNS, see Section 2.3.4, “Installing a Server Without Integrated DNS”
Important
Maintenance Requirements for Integrated or External DNS
- set up correct delegation from the parent domain to the IdM serversFor example, if the IdM domain name is
ipa.example.com, it must be properly delegated from theexample.comdomain.Note
You can verify the delegation using the following command:# dig @IP_address +norecurse +short ipa.example.com. NS
IP_address is the IP address of the server that manages theexample.comDNS domain. If the delegation is correct, the command lists the IdM servers that have a DNS server installed.
- manually create the new domain on the DNS server
- fill the new domain manually with records from the zone file that is generated by the IdM installer
- manually update the records after installing or removing a replica, as well as after any changes in the service configuration, such as after an Active Directory trust is configured
Preventing DNS Amplification Attacks
/etc/named.conf file on your server. For example:
acl authorized { 192.0.2.0/24; 198.51.100.0/24; };
options {
allow-query { any; };
allow-recursion { authorized; };
};2.3.2. Determining What CA Configuration to Use
- Server with an integrated IdM CA
- This is the default configuration suitable for most deployments. Certificate System uses a CA signing certificate to create and sign the certificates in the IdM domain.
Warning
Red Hat strongly recommends to keep the CA services installed on more than one server. For information on installing a replica of the initial server including the CA services, see Section 4.5.4, “Installing a Replica with a CA”.If you install the CA on only one server, you risk losing the CA configuration without a chance of recovery if the CA server fails. See Section B.2.6, “Recovering a Lost CA Server” for details.The CA signing certificate must signed by a root CA, which is the highest CA in the CA hierarchy. The root CA can be the IdM CA itself or an externally-hosted CA.- The IdM CA is the root CA
- This is the default configuration.To install a server with this configuration, see Section 2.3.3, “Installing a Server with Integrated DNS” and Section 2.3.4, “Installing a Server Without Integrated DNS”.
- An external CA is the root CA
- The IdM CA is subordinate to an external CA. However, all certificates for the IdM domain are still issued by the Certificate System instance.The external CA can be a corporate CA or a third-party CA, such as Verisign or Thawte. The certificates issued within the IdM domain are potentially subject to restrictions set by the external root CA for attributes like the validity period.To install a server with an externally-hosted root CA, see Section 2.3.5, “Installing a Server with an External CA as the Root CA”
- Server without a CA
- This configuration option is suitable for very rare cases when restrictions within the infrastructure do not allow to install certificate services with the server.You must request these certificates from a third-party authority prior to the installation:
- An LDAP server certificate and a private key
- An Apache server certificate and a private key
- Full CA certificate chain of the CA that issued the LDAP and Apache server certificates
Managing certificates without the integrated IdM CA presents a significant maintenance burden. Most notably:- Creating, uploading, and renewing certificates is a manual process.
- The
certmongerservice is not used to track certificates. Therefore, it does not warn you of impending certificate expiration.
To install a server without an integrated CA, see Section 2.3.6, “Installing Without a CA”Note
If you install an IdM domain without a CA, you can install the CA services afterwards. To install a CA to already existing IdM domain, see Section 26.8, “Installing a CA Into an Existing IdM Domain”.
2.3.3. Installing a Server with Integrated DNS
Note
- DNS forwarders
- The following DNS forwarder settings are supported:
- one or more forwarders (the
--forwarderoption in non-interactive installation) - no forwarders (the
--no-forwardersoption in non-interactive installation)
If you are unsure whether to use DNS forwarding, see Section 33.6, “Managing DNS Forwarding”. - Reverse DNS zones
- The following reverse DNS zone settings are supported:
- automatic detection of the reverse zones that need to be created in IdM DNS (the default setting in interactive installation, the
--auto-reverseoption in non-interactive installation) - no reverse zone auto-detection (the
--no-reverseoption in interactive installation)
Note that the--allow-zone-overlapoption is ignored if the--auto-reverseoption is set. Using the combination of options:$ ipa-server-install --auto-reverse --allow-zone-overlap
thus does not create reverse zones which would overlap with already existing DNS zones, for example on another DNS server.
--setup-dns option as well.
Example 2.1. Installing a Server with Integrated DNS
- with integrated DNS
- with integrated IdM CA as the root CA, which is the default CA configuration
- Run the
ipa-server-installutility.# ipa-server-install
- The script prompts to configure an integrated DNS service. Enter
yes.Do you want to configure integrated DNS (BIND)? [no]:
yes - The script prompts for several required settings.
- To accept the default values in brackets, press Enter.
- To provide a value different than the proposed default value, enter the required value.
Server host name [server.example.com]: Please confirm the domain name [example.com]: Please provide a realm name [EXAMPLE.COM]:
Warning
Red Hat strongly recommends that the Kerberos realm name is the same as the primary DNS domain name, with all letters uppercase. For example, if the primary DNS domain isipa.example.com, useIPA.EXAMPLE.COMfor the Kerberos realm name.Different naming practices will prevent you from using Active Directory trusts and can have other negative consequences. - Enter the passwords for the Directory Server superuser,
cn=Directory Manager, and for theadminIdM system user account.Directory Manager password: IPA admin password:
- The script prompts for DNS forwarders.
Do you want to configure DNS forwarders? [yes]:
- To configure DNS forwarders, enter
yes, and then follow the instructions on the command line.The installation process will add the forwarder IP addresses to the/etc/named.conffile on the installed IdM server.- For the forwarding policy default settings, see the
--forward-policydescription in the ipa-dns-install(1) man page. - See also the section called “Forward Policies” for details.
- If you do not want to use DNS forwarding, enter
no.
- The script prompts to check if any DNS reverse (PTR) records for the IP addresses associated with the server need to be configured.
Do you want to search for missing reverse zones? [yes]:
If you run the search and missing reverse zones are discovered, the script asks you whether to create the reverse zones along with the PTR records.Do you want to create reverse zone for IP 192.0.2.1 [yes]: Please specify the reverse zone name [2.0.192.in-addr.arpa.]: Using reverse zone(s) 2.0.192.in-addr.arpa.
Note
Using IdM to manage reverse zones is optional. You can use an external DNS service for this purpose instead. - Enter
yesto confirm the server configuration.Continue to configure the system with these values? [no]:
yes - The installation script now configures the server. Wait for the operation to complete.
- Add DNS delegation from the parent domain to the IdM DNS domain. For example, if the IdM DNS domain is
ipa.example.com, add a name server (NS) record to theexample.comparent domain.Important
This step must be repeated each time an IdM DNS server is installed.
- Authenticate to the Kerberos realm using the admin credentials. This verifies that
adminis properly configured and the Kerberos realm is accessible.# kinit admin
- Run a command such as
ipa user-find. On a new server, the command prints the only configured user:admin.# ipa user-find admin -------------- 1 user matched -------------- User login: admin Last name: Administrator Home directory: /home/admin Login shell: /bin/bash UID: 939000000 GID: 939000000 Account disabled: False Password: True Kerberos keys available: True ---------------------------- Number of entries returned 1 ----------------------------
2.3.4. Installing a Server Without Integrated DNS
Note
ipa-server-install utility without any DNS-related options.
Example 2.2. Installing a Server Without Integrated DNS
- without integrated DNS
- with integrated IdM CA as the root CA, which is the default CA configuration
- Run the
ipa-server-installutility.# ipa-server-install
- The script prompts to configure an integrated DNS service. Press Enter to select the default
nooption.Do you want to configure integrated DNS (BIND)? [no]:
- The script prompts for several required settings.
- To accept the default values in brackets, press Enter.
- To provide a value different than the proposed default value, enter the required value.
Server host name [server.example.com]: Please confirm the domain name [example.com]: Please provide a realm name [EXAMPLE.COM]:
Warning
Red Hat strongly recommends that the Kerberos realm name is the same as the primary DNS domain name, with all letters uppercase. For example, if the primary DNS domain isipa.example.com, useIPA.EXAMPLE.COMfor the Kerberos realm name.Different naming practices will prevent you from using Active Directory trusts and can have other negative consequences. - Enter the passwords for the Directory Server superuser,
cn=Directory Manager, and for theadminIdM system user account.Directory Manager password: IPA admin password:
- Enter
yesto confirm the server configuration.Continue to configure the system with these values? [no]:
yes - The installation script now configures the server. Wait for the operation to complete.
- The installation script produces a file with DNS resource records: the
/tmp/ipa.system.records.UFRPto.dbfile in the example output below. Add these records to the existing external DNS servers. The process of updating the DNS records varies depending on the particular DNS solution.... Restarting the KDC Please add records in this file to your DNS system: /tmp/ipa.system.records.UFRBto.db Restarting the web server ...Important
The server installation is not complete until you add the DNS records to the existing DNS servers.
- Authenticate to the Kerberos realm using the admin credentials. This verifies that
adminis properly configured and the Kerberos realm is accessible.# kinit admin
- Run a command such as
ipa user-find. On a new server, the command prints the only configured user:admin.# ipa user-find admin -------------- 1 user matched -------------- User login: admin Last name: Administrator Home directory: /home/admin Login shell: /bin/bash UID: 939000000 GID: 939000000 Account disabled: False Password: True Kerberos keys available: True ---------------------------- Number of entries returned 1 ----------------------------
2.3.5. Installing a Server with an External CA as the Root CA
Note
ipa-server-install utility:
--external-caspecifies that you want to use an external CA.--external-ca-typespecifies the type of the external CA. See the ipa-server-install(1) man page for details.
/root/ipa.csr:
...
Configuring certificate server (pki-tomcatd): Estimated time 3 minutes 30 seconds
[1/8]: creating certificate server user
[2/8]: configuring certificate server instance
The next step is to get /root/ipa.csr signed by your CA and re-run /sbin/ipa-server-install as: /sbin/ipa-server-install --external-cert-file=/path/to/signed_certificate --external-cert-file=/path/to/external_ca_certificate- Submit the CSR located in
/root/ipa.csrto the external CA. The process differs depending on the service to be used as the external CA.Important
It might be necessary to request the appropriate extensions for the certificate. The CA signing certificate generated for the Identity Management server must be a valid CA certificate. This requires either that the Basic Constraint be set to CA=true or that the Key Usage Extension be set on the signing certificate to allow it to sign certificates. - Retrieve the issued certificate and the CA certificate chain for the issuing CA in a base 64-encoded blob (either a PEM file or a Base_64 certificate from a Windows CA). Again, the process differs for every certificate service. Usually, a download link on a web page or in the notification email allows the administrator to download all the required certificates.
Important
Be sure to get the full certificate chain for the CA, not just the CA certificate. - Run
ipa-server-installagain, this time specifying the locations and names of the newly-issued CA certificate and the CA chain files. For example:# ipa-server-install --external-cert-file=/tmp/servercert20110601.pem --external-cert-file=/tmp/cacert.pem
Note
ipa-server-install --external-ca command can sometimes fail with the following error:
ipa : CRITICAL failed to configure ca instance Command '/usr/sbin/pkispawn -s CA -f /tmp/configuration_file' returned non-zero exit status 1 Configuration of CA failed
*_proxy environmental variables are set. For a solution on how to fix this problem, see Section B.1.1, “External CA Installation Fails”
2.3.6. Installing Without a CA
Note
ipa-server-install utility. Other than that, most of the installation procedure is the same as in Section 2.3.3, “Installing a Server with Integrated DNS” or Section 2.3.4, “Installing a Server Without Integrated DNS”.
Important
Certificates Required to Install an IdM Server without a CA
- The LDAP server certificate and private key, supplied using these options:
--dirsrv-cert-filefor the certificate and private key files for the LDAP server certificate--dirsrv-pinfor the password to access the private key in the files specified in--dirsrv-cert-file
- The Apache server certificate and private key, supplied using these options:
--http-cert-filefor the certificate and private key files for the Apache server certificate--http-pinfor the password to access the private key in the files specified in--http-cert-file
- The full CA certificate chain of the CA that issued the LDAP and Apache server certificates, supplied using these options:
--dirsrv-cert-fileand--http-cert-filefor the certificate files with the full CA certificate chain or a part of itThe files provided using--dirsrv-cert-fileand--http-cert-filemust contain exactly one server certificate and exactly one private key. The contents of the files provided using--dirsrv-cert-fileand--http-cert-fileare often identical.
- If necessary, the certificate files to complete the full CA certificate chain, supplied using this option:
--ca-cert-file, which you can add this option multiple times
- Optionally, the certificate files to provide an external Kerberos key distribution center (KDC) PKINIT certificate, supplied using these options:
--pkinit-cert-filefor the Kerberos KDC SSL certificate and private key--pkinit-pinfor the password to unlock the Kerberos KDC private key
If you do not provide the PKINIT certificate,ipa-server-installconfigures the IdM server with a local KDC with a self-signed certificate. For details, see Chapter 27, Kerberos PKINIT Authentication in IdM.
--dirsrv-cert-file and --http-cert-file combined with the files provided using --ca-cert-file must contain the full CA certificate chain of the CA that issued the LDAP and Apache server certificates.
Note
--external-ca option.
Note
--root-ca-file option to specify the PEM file of the root CA certificate. This is no longer necessary because the trusted CA is always the issuer of the DS and HTTP server certificates. IdM now automatically recognizes the root CA certificate from the certificates specified by --dirsrv-cert-file, --http-cert-file, and --ca-cert-file.
Example 2.3. Command example for installing an IdM server without a CA
[root@server ~]# ipa-server-install \
--http-cert-file /tmp/server.crt \
--http-cert-file /tmp/server.key \
--http-pin secret \
--dirsrv-cert-file /tmp/server.crt \
--dirsrv-cert-file /tmp/server.key \
--dirsrv-pin secret \
--ca-cert-file ca.crt2.3.7. Installing a Server Non-Interactively
Note
--ds-passwordto provide the password for the Directory Manager (DM), the Directory Server super user--admin-passwordto provide the password foradmin, the IdM administrator--realmto provide the Kerberos realm name--unattendedto let the installation process select default options for the host name and domain nameOptionally, you can provide custom values for these settings:--hostnamefor the server host name--domainfor the domain name
Warning
ipa.example.com, use IPA.EXAMPLE.COM for the Kerberos realm name.
ipa-server-install, run the ipa-server-install --help command.
Example 2.4. Basic Installation without Interaction
- Run the
ipa-server-installutility, providing the required settings. For example, the following installs a server without integrated DNS and with an integrated CA:# ipa-server-install --realm EXAMPLE.COM --ds-password DM_password --admin-password admin_password --unattended
- The setup script now configures the server. Wait for the operation to complete.
- The installation script produces a file with DNS resource records: the
/tmp/ipa.system.records.UFRPto.dbfile in the example output below. Add these records to the existing external DNS servers. The process of updating the DNS records varies depending on the particular DNS solution.... Restarting the KDC Please add records in this file to your DNS system: /tmp/ipa.system.records.UFRBto.db Restarting the web server ...Important
The server installation is not complete until you add the DNS records to the existing DNS servers.
- Authenticate to the Kerberos realm using the admin credentials. This verifies that
adminis properly configured and the Kerberos realm is accessible.# kinit admin
- Run a command such as
ipa user-find. On a new server, the command prints the only configured user:admin.# ipa user-find admin -------------- 1 user matched -------------- User login: admin Last name: Administrator Home directory: /home/admin Login shell: /bin/bash UID: 939000000 GID: 939000000 Account disabled: False Password: True Kerberos keys available: True ---------------------------- Number of entries returned 1 ----------------------------
2.4. Uninstalling an IdM Server
Note
0, the procedure is different. See Section D.3.6, “Removing a Replica”.
Prerequisites
- Before uninstalling a server that serves as a certificate authority (CA), key recovery authority (KRA), or DNS Security Extensions (DNSSEC) server, make sure these services are running on another server in the domain.
Warning
Removing the last replica that serves as a CA, KRA, or DNSSEC server can seriously disrupt the Identity Management functionality.
Procedure
server.example.com:
- On another server, use the
ipa server-delcommand to deleteserver.example.comfrom the topology:[root@another_server ~]
# ipa server-del server.example.com - On
server.example.com, use theipa-server-install --uninstallcommand:[root@server ~]
# ipa-server-install --uninstall - Make sure all name server (NS) DNS records pointing to
server.example.comare deleted from your DNS zones. This applies regardless of whether you use integrated DNS managed by IdM or external DNS.
2.5. Renaming a Server
- Create a new replica of the server, with a CA and with the new required host name or IP address. This is described in Chapter 4, Installing and Uninstalling Identity Management Replicas.
- Stop the initial IdM server instance.
[root@old_server ~]# ipactl stop
- Verify that all other replicas and clients are working as before.
- Uninstall the initial IdM server, as described in Section 2.4, “Uninstalling an IdM Server”
Chapter 3. Installing and Uninstalling Identity Management Clients
Note
3.1. Prerequisites for Installing a Client
- DNS requirements
- Employ proper DNS delegation. For details on DNS requirements in IdM, see Section 2.1.3, “Host Name and DNS Configuration”.Do not alter the
resolv.conffile on clients. - Port requirements
- IdM clients connect to a number of ports on IdM servers to communicate with their services. These ports must be open on the IdM servers in the incoming direction. For more information on which ports IdM requires, see Section 2.1.4, “Port Requirements”.On a client, open these ports in the outgoing direction. If you are using a firewall that does not filter outgoing packets, such as
firewalld, the ports are already available in the outgoing direction.
- Federal Information Processing Standard (FIPS) support
- In environments set up using Red Hat Enterprise Linux 7.4 and later:
- You can configure a new IdM server, replica, or client on a system with the FIPS mode enabled. The installation script automatically detects a system with FIPS enabled and configures IdM without the administrator's intervention.To enable FIPS in the operating system, see Enabling FIPS Mode in the Security Guide.
Important
You cannot:- Enable FIPS mode on existing IdM servers previously installed with FIPS mode disabled.
- Install a replica in FIPS mode when using an existing IdM server with FIPS mode disabled.
In environments set up using Red Hat Enterprise Linux 7.3 and earlier:- IdM does not support the FIPS mode. Disable FIPS on your system before installing an IdM server, replica, or client, and do not enable it after the installation.
For further details about FIPS mode, see Federal Information Processing Standard (FIPS) in the Security Guide. - Name Service Cache Daemon (NSCD) requirements
- Red Hat recommends to disable NSCD on Identity Management machines. Alternatively, if disabling NSCD is not possible, only enable NSCD for maps that SSSD does not cache.Both NSCD and the SSSD service perform caching, and problems can occur when systems use both services simultaneously. See the System-Level Authentication Guide for information on how to avoid conflicts between NSCD and SSSD.
3.2. Packages Required to Install a Client
# yum install ipa-client
3.3. Installing a Client
ipa-client-install utility installs and configures an IdM client. The installation process requires you to provide credentials that can be used to enroll the client. The following authentication methods are supported:
- Credentials of a user authorized to enroll clients, such as
admin - By default,
ipa-client-installexpects this option. See Section 3.3.1, “Installing a Client Interactively” for an example.To provide the user credentials directly toipa-client-install, use the--principaland--passwordoptions. - A random, one-time password pre-generated on the server
- To use this authentication method, add the
--randomoption toipa-client-installoption. See Example 3.1, “Installing a Client Non-interactively Using a Random Password”. - A principal from a previous enrollment
- To use this authentication method, add the
--keytaboption toipa-client-install. See Section 3.8, “Re-enrolling a Client into the IdM Domain” for details.
ipa-client-install and a complete list of the accepted options, see the ipa-client-install(1) man page.
3.3.1. Installing a Client Interactively
admin user.
- Run the
ipa-client-installutility.Add the--enable-dns-updatesoption to update the DNS records with the client machine's IP address if one of the following applies:- the IdM server the client will be enrolled with was installed with integrated DNS
- the DNS server on the network accepts DNS entry updates with the GSS-TSIG protocol
Add the--no-krb5-offline-passwordsoption to disable storing Kerberos passwords in the SSSD cache. - The installation script attempts to obtain all the required settings automatically.
- If your DNS zone and SRV records are set properly on your system, the script automatically discovers all the required values and prints them. Enter
yesto confirm.Client hostname: client.example.com Realm: EXAMPLE.COM DNS Domain: example.com IPA Server: server.example.com BaseDN: dc=example,dc=com Continue to configure the system with these values? [no]:
yesIf you want to install the system with different values, cancel the current installation. Then runipa-client-installagain, and specify the required values using command-line options.For details, see theDNS Autodiscoverysection in the ipa-client-install(1) man page. - If the script fails to obtain some settings automatically, it prompts you for the values.
Important
The fully qualified domain name must be a valid DNS name, which means only numbers, alphabetic characters, and hyphens (-) are allowed. Other characters, like underscores, in the host name cause DNS failures. Additionally, the host name must be all lower-case; no capital letters are allowed.For other recommended naming practices, see the Red Hat Enterprise Linux Security Guide.
- The script prompts for a user whose identity will be used to enroll the client. By default, this is the
adminuser:User authorized to enroll computers:
adminPassword for admin@EXAMPLE.COM - The installation script now configures the client. Wait for the operation to complete.
Client configuration complete.
- Run the
ipa-client-automountutility, which automatically configures NFS for IdM. See Section 34.2.1, “Configuring NFS Automatically” for details.
3.3.2. Installing a Client Non-interactively
ipa-client-install utility using command-line options. The minimum required options for a non-interactive installation are:
- options for specifying the credentials that will be used to enroll the client; see Section 3.3, “Installing a Client” for details
--unattendedto let the installation run without requiring user confirmation
--hostnameto specify a static host name for the client machineImportant
The fully qualified domain name must be a valid DNS name, which means only numbers, alphabetic characters, and hyphens (-) are allowed. Other characters, like underscores, in the host name cause DNS failures. Additionally, the host name must be all lower-case; no capital letters are allowed.For other recommended naming practices, see the Red Hat Enterprise Linux Security Guide.--serverto specify the host name of the IdM server the client will be enrolled with--domainto specify the DNS domain name of the IdM server the client will be enrolled with--realmto specify the Kerberos realm name
--enable-dns-updates option to update the DNS records with the client machine's IP address if one of the following applies:
- the IdM server the client will be enrolled with was installed with integrated DNS
- the DNS server on the network accepts DNS entry updates with the GSS-TSIG protocol
--no-krb5-offline-passwords option to disable storing Kerberos passwords in the SSSD cache.
ipa-client-install, see the ipa-client-install(1) man page.
Example 3.1. Installing a Client Non-interactively Using a Random Password
- On an existing server:
- Log in as the administrator:
$ kinit admin
- Add the new machine as an IdM host. Use the
--randomoption with theipa host-addcommand to generate the random password.$ ipa host-add client.example.com --random -------------------------------------------------- Added host "client.example.com" -------------------------------------------------- Host name: client.example.com Random password: W5YpARl=7M.n Password: True Keytab: False Managed by: server.example.com
The generated password will become invalid after you use it to enroll the machine into the IdM domain. It will be replaced with a proper host keytab after the enrollment is finished.
- On the machine where you want to install the client, run
ipa-client-install, and use these options:--passwordfor the random password from theipa host-addoutputNote
The password often contains special characters. Therefore, enclose it in single quotes (').--unattendedto let the installation run without requiring user confirmation
If your DNS zone and SRV records are set properly on your system, the script automatically discovers all the other required values. If the script cannot discover the values automatically, provide them using command-line options.For example:# ipa-client-install --password 'W5YpARl=7M.n' --domain example.com --server server.example.com --unattended
- Run the
ipa-client-automountutility, which automatically configures NFS for IdM. See Section 34.2.1, “Configuring NFS Automatically” for details.
3.4. Setting up an IdM Client Through Kickstart
3.4.1. Pre-creating a Client Host Entry on the IdM Server
- Log in as admin:
$ kinit admin
- Create the host entry on the IdM server, and set a temporary password for the entry:
$ ipa host-add client.example.com --password=secret
The password is used by Kickstart to authenticate during the client installation and expires after the first authentication attempt. After the client is successfully installed, it authenticates using its keytab.
3.4.2. Creating a Kickstart File for the Client
- The ipa-client package in the list of packages to be installed:
%packages @ X Window System @ Desktop @ Sound and Video
ipa-client...See Package Selection in the Installation Guide for details. - Post-installation instructions that:
- ensure SSH keys are generated before enrollment
- runs the
ipa-client-installutility, specifying:- all required information to access and configure the IdM domain services
- the password which you set when pre-creating the client host on the IdM server, in Section 3.4.1, “Pre-creating a Client Host Entry on the IdM Server”
For example:%post --log=/root/ks-post.log # Generate SSH keys to ensure that ipa-client-install uploads them to the IdM server /usr/sbin/sshd-keygen # Run the client install script /usr/sbin/ipa-client-install --hostname=client.example.com --domain=EXAMPLE.COM --enable-dns-updates --mkhomedir -w secret --realm=EXAMPLE.COM --server=server.example.com
For a non-interactive installation, add also the--unattendedoption.To let the client installation script request a certificate for the machine:- Add the
--request-certoption toipa-client-install. - Set the system bus address to
/dev/nullfor both thegetcertandipa-client-installutility in the kickstartchrootenvironment. To do this, add these lines to the post-installation instruction file before theipa-client-installinstruction:# env DBUS_SYSTEM_BUS_ADDRESS=unix:path=/dev/null getcert list # env DBUS_SYSTEM_BUS_ADDRESS=unix:path=/dev/null ipa-client-install
Note
Red Hat recommends not to start thesshdservice prior to the kickstart enrollment. While startingsshdbefore enrolling the client generates the SSH keys automatically, using the above script is the preferred solution.See Post-installation Script in the Installation Guide for details.
3.5. Post-installation Considerations for Clients
3.5.1. Removing Pre-Identity Management Configuration
ipa-client-install script does not remove any previous LDAP and SSSD configuration from the /etc/openldap/ldap.conf and /etc/sssd/sssd.conf files. If you modified the configuration in these files before installing the client, the script adds the new client values, but comments them out. For example:
BASE dc=example,dc=com URI ldap://ldap.example.com #URI ldaps://server.example.com # modified by IPA #BASE dc=ipa,dc=example,dc=com # modified by IPA
- Open
/etc/openldap/ldap.confand/etc/sssd/sssd.conf. - Delete the previous configuration.
- Uncomment the new Identity Management configuration.
- Server processes that rely on system-wide LDAP configuration might require a restart to apply the changes. Applications that use
openldaplibraries typically import the configuration when started.
3.6. Testing the New Client
admin user:
[user@client ~]$ id admin uid=1254400000(admin) gid=1254400000(admins) groups=1254400000(admins)
3.7. Uninstalling a Client
- Run the
ipa-client-install --uninstallcommand:# ipa-client-install --uninstall
- Remove the DNS entries for the client host manually from the server. See Section 33.4.6, “Deleting Records from DNS Zones”.
3.8. Re-enrolling a Client into the IdM Domain
- Interactively, using administrator credentials. See Section 3.8.1, “Re-enrolling a Client Interactively Using the Administrator Account”.
- Non-interactively, using a previously backed-up keytab file. See Section 3.8.2, “Re-enrolling a Client Non-interactively Using the Client Keytab”.
Note
ipa-client-install --uninstall) or disabled its host entry (using ipa host-disable), you cannot re-enroll it.
- Revokes the original host certificate
- Generates a new host certificate
- Creates new SSH keys
- Generates a new keytab
3.8.1. Re-enrolling a Client Interactively Using the Administrator Account
- Re-create the client machine with the same host name.
- Run the
ipa-client-install --force-joincommand on the client machine:# ipa-client-install --force-join
- The script prompts for a user whose identity will be used to enroll the client. By default, this is the
adminuser:User authorized to enroll computers:
adminPassword for admin@EXAMPLE.COM
3.8.2. Re-enrolling a Client Non-interactively Using the Client Keytab
- Back up the original client's keytab file, for example in the
/tmpor/rootdirectory. - Re-create the client machine with the same host name.
- Re-enroll the client, and specify the keytab location using the
--keytaboption:# ipa-client-install --keytab /tmp/krb5.keytab
Note
The keytab specified in the--keytaboption is only used when authenticating to initiate the enrollment. During the re-enrollment, IdM generates a new keytab for the client.
3.9. Renaming Client Machines
Warning
Identifying Current Service and Keytab Configuration
- Identify which services are running on the machine:
- Use the
ipa service-findcommand, and identify services with certificates in the output:$ ipa service-find client.example.com
- In addition, each host has a default host service which does not appear in the
ipa service-findoutput. The service principal for the host service, also called a host principal, ishost/client.example.com.
- Identify all host groups to which the machine belongs.
# ipa hostgroup-find client.example.com
- For all service principals displayed by
ipa service-find client.example.com, determine the location of the corresponding keytabs onclient.example.com.Each service on the client system has a Kerberos principal in the form service_name/hostname@REALM, such asldap/client.example.com@EXAMPLE.COM.
Removing the Client Machine from the IdM Domain
- Unenroll the client machine from the IdM domain. See Section 3.7, “Uninstalling a Client”.
- For each identified keytab other than
/etc/krb5.keytab, remove the old principals:[root@client ~]# ipa-rmkeytab -k /path/to/keytab -r EXAMPLE.COM
- On an IdM server, remove the host entry. This removes all services and revokes all certificates issued for that host:
[root@server ~]# ipa host-del client.example.com
Re-enrolling the Client with a New Host Name
- Rename the machine as required.
- Re-enroll the machine as an IdM client. See Section 3.8, “Re-enrolling a Client into the IdM Domain”.
- On an IdM server, add a new keytab for every service identified in the section called “Identifying Current Service and Keytab Configuration”.
[root@server ~]# ipa service-add service_name/new_host_name
- Generate certificates for services that had a certificate assigned in the section called “Identifying Current Service and Keytab Configuration”. You can do this:
- Using the IdM administration tools. See Chapter 24, Managing Certificates for Users, Hosts, and Services.
- Using the
certmongerutility. See Working with certmonger in the System-Level Authentication Guide or the certmonger(8) man page.
- Re-add the client to the host groups identified in the section called “Identifying Current Service and Keytab Configuration”. See Section 13.3, “Adding and Removing User or Host Group Members”.
Chapter 4. Installing and Uninstalling Identity Management Replicas
Note
ipa-backup utility, as described in Chapter 9, Backing Up and Restoring Identity Management.
4.1. Explaining IdM Replicas
Note

Figure 4.1. Server and Replica Agreements
4.2. Deployment Considerations for Replicas
4.2.1. Distribution of Server Services in the Topology

Figure 4.2. Replicas with Different Services
CA Services on Replicas
Warning
- For example, if the server includes an integrated IdM CA as the root CA, the replica must also be installed with an integrated CA as the root CA.
- See Section 2.3.2, “Determining What CA Configuration to Use” for the supported CA configuration options.
4.2.2. Replica Topology Recommendations
- Configure no more than 60 replicas in a single IdM domain
- Red Hat guarantees to support environments with 60 replicas or less.
- Configure at least two, but no more than four replication agreements per each replica
- Configuring additional replication agreements ensures that information is replicated not just between the initial replica and the master server, but between other replicas as well.
- If you create replica B from server A and then replica C from server A, replicas B and C are not directly joined, so data from replica B must first be replicated to server A before propagating to replica C.

Figure 4.3. Replicas B and C Are Not Joined in a Replication Agreement
Setting up an additional replication agreement between replica B and replica C ensures the data is replicated directly, which improves data availability, consistency, failover tolerance, and performance.
Figure 4.4. Replicas B and C Are Joined in a Replication Agreement
See Chapter 6, Managing Replication Topology for details on managing replication agreements.
Configuring more than four replication agreements per replica is unnecessary. A large number of replication agreements per server does not bring significant additional benefits, because one consumer server can only be updated by one master at a time, so the other agreements are meanwhile idle and waiting. Additionally, configuring too many replication agreements can have a negative impact on overall performance.Note
Theipa topologysuffix-verifycommand checks if your topology meets the most important recommendations. Runipa topologysuffix-verify --helpfor details.The command requires you to specify the topology suffix. See Section 6.1, “Explaining Replication Agreements, Topology Suffixes, and Topology Segments” for details.

Figure 4.5. Topology Example
4.2.2.1. Tight Cell Topology
- Each of the cells is a tight cell, where all servers have replication agreements with each other.
- Each server has one replication agreement with another server outside the cell. This ensures that every cell is loosely coupled to every other cell in the domain.
- Have at least one IdM server in each main office, data center, or locality. Preferably, have two IdM servers.
- Do not have more than four servers per data center.
- In small offices, rather than using a replica, use SSSD to cache credentials and an off-site IdM server as the data back end.
4.3. Prerequisites for Installing a Replica
- The replica must be running the same or later version of IdM
- For example, if the master server is running on Red Hat Enterprise Linux 7 and uses the IdM 4.4 packages, then the replica must also run on Red Hat Enterprise Linux 7 or later and use IdM version 4.4 or later. This ensures that configuration can be properly copied from the server to the replica.
Important
IdM does not support creating a replica of an earlier version than the version of the master. If you try to create a replica using an earlier version, the installation fails. - The replica needs additional ports to be open
- In addition to the standard IdM server port requirements described in Section 2.1.4, “Port Requirements”, make sure you also meet the following:
- At domain level 0, keep the TCP port 22 open on the master server during the replica setup process. This port is required in order to use SSH to connect to the master server.
Note
For details on domain levels, see Chapter 7, Displaying and Raising the Domain Level. - If one of the servers is running Red Hat Enterprise Linux 6 and has a CA installed, keep also TCP port 7389 open during and after the replica configuration. In a purely Red Hat Enterprise Linux 7 environment, port 7389 is not required.
For information on how to open ports using thefirewall-cmdutility, see Section 2.1.4, “Port Requirements”.
4.4. Packages Required to Install a Replica
4.5. Creating the Replica: Introduction
ipa-replica-install utility is used to install a new replica from an existing IdM server. Install Identity Management replicas one at a time. The installation of multiple replicas at the same time is not supported.
Note
- on an existing IdM client by promoting the client to a replica: see the section called “Promoting an Existing Client to a Replica”
- on a machine that has not yet been enrolled in the IdM domain: see the section called “Installing a Replica on a Machine That Is Not a Client”
ipa-replica-install: see the section called “Using ipa-replica-install to Configure the Replica for Your Use Case”.
Important
ipa-replica-install. See Trust Controllers and Trust Agents in the Windows Integration Guide.
Promoting an Existing Client to a Replica
- Provide a privileged user's credentials
- The default privileged user is
admin. There are multiple ways to provide the user's credentials. You can:- let IdM prompt you to get the credentials interactively
Note
This is the default way to provide the privileged user's credentials. If no credentials are available whenipa-replica-installruns, the installation automatically prompts you. - log in as the user before running
ipa-replica-installon the client:$ kinit admin
- add the user's principal name and password to
ipa-replica-installdirectly:# ipa-replica-install --principal admin --admin-password admin_password
- Add the client to the
ipaservershost group - Membership in
ipaserversgrants the machine elevated privileges analogous to a privileged user's credentials. You will not be required to provide the user's credentials.
Installing a Replica on a Machine That Is Not a Client
ipa-replica-install first enrolls the machine as a client and then installs the replica components.
- Provide a privileged user's credentials
- The default privileged user is
admin. To provide the credentials, add the principal name and password toipa-replica-installdirectly:# ipa-replica-install --principal admin --admin-password admin_password
- Provide a random password for the client
- You must generate the random password on a server before installing the replica. You will not be required to provide the user's credentials during the installation.
ipa-replica-install:
--serverfor the server's fully qualified domain name (FQDN)--domainfor the IdM DNS domain
Using ipa-replica-install to Configure the Replica for Your Use Case
ipa-replica-install only sets up basic server services. To install additional services, such as DNS or a certificate authority (CA), add options to ipa-replica-install.
Warning
- Section 4.5.4, “Installing a Replica with a CA”, using
--setup-ca - Section 4.5.5, “Installing a Replica from a Server without a CA”, using
--dirsrv-cert-file,--dirsrv-pin,--http-cert-file, and--http-pin
4.5.1. Promoting a Client to a Replica Using a Host Keytab
- On an existing server:
- Log in as the administrator.
$ kinit admin
- Add the client machine to the
ipaservershost group.$ ipa hostgroup-add-member ipaservers --hosts client.example.com Host-group: ipaservers Description: IPA server hosts Member hosts: server.example.com, client.example.com ------------------------- Number of members added 1 -------------------------
Membership inipaserversgrants the machine elevated privileges analogous to the administrator's credentials.
- On the client, run the
ipa-replica-installutility.# ipa-replica-install
4.5.2. Installing a Replica Using a Random Password
- On an existing server:
- Log in as the administrator.
$ kinit admin
- Add the new machine as an IdM host. Use the
--randomoption with theipa host-addcommand to generate a random one-time password to be used for the replica installation.$ ipa host-add client.example.com --random -------------------------------------------------- Added host "client.example.com" -------------------------------------------------- Host name: client.example.com Random password: W5YpARl=7M.n Password: True Keytab: False Managed by: server.example.comThe generated password will become invalid after you use it to enroll the machine into the IdM domain. It will be replaced with a proper host keytab after the enrollment is finished. - Add the machine to the
ipaservershost group.$ ipa hostgroup-add-member ipaservers --hosts client.example.com Host-group: ipaservers Description: IPA server hosts Member hosts: server.example.com, client.example.com ------------------------- Number of members added 1 -------------------------
Membership inipaserversgrants the machine elevated privileges required to set up the necessary server services.
- On the machine where you want to install the replica, run
ipa-replica-install, and provide the random password using the--passwordoption. Enclose the password in single quotes (') because it often contains special characters:# ipa-replica-install --password 'W5YpARl=7M.n'
4.5.3. Installing a Replica with DNS
- Run
ipa-replica-installwith these options:--setup-dnsto create a DNS zone if it does not exist already and configure the replica as the DNS server--forwarderto specify a forwarder, or--no-forwarderif you do not want to use any forwardersTo specify multiple forwarders for failover reasons, use--forwardermultiple times.
For example:# ipa-replica-install --setup-dns --forwarder 192.0.2.1
Note
Theipa-replica-installutility accepts a number of other options related to DNS settings, such as--no-reverseor--no-host-dns. For more information about them, see the ipa-replica-install(1) man page. - If the initial server was created with DNS enabled, the replica is automatically created with the proper DNS entries. The entries ensure that IdM clients will be able to discover the new server.If the initial server did not have DNS enabled, add the DNS records manually. The following DNS records are necessary for the domain services:
_ldap._tcp_kerberos._tcp_kerberos._udp_kerberos-master._tcp_kerberos-master._udp_ntp._udp_kpasswd._tcp_kpasswd._udp
This example shows how to verify that the entries are present:- Set the appropriate values for the DOMAIN and NAMESERVER variables:
# DOMAIN=example.com # NAMESERVER=replica
- Use the following command to check for the DNS entries:
# for i in _ldap._tcp _kerberos._tcp _kerberos._udp _kerberos-master._tcp _kerberos-master._udp _ntp._udp ; do dig @${NAMESERVER} ${i}.${DOMAIN} srv +nocmd +noquestion +nocomments +nostats +noaa +noadditional +noauthority done | egrep "^_" _ldap._tcp.example.com. 86400 IN SRV 0 100 389 server1.example.com. _ldap._tcp.example.com. 86400 IN SRV 0 100 389 server2.example.com. _kerberos._tcp.example.com. 86400 IN SRV 0 100 88 server1.example.com. ...
- Optional, but recommended. Manually add other DNS servers as backup servers in case the replica becomes unavailable. See Section 33.11.1, “Setting up Additional Name Servers”. This is recommended especially for situations when the new replica is your first DNS server in the IdM domain.
4.5.4. Installing a Replica with a CA
- Run
ipa-replica-installwith the--setup-caoption.[root@replica ~]# ipa-replica-install --setup-ca
- The
--setup-caoption copies the CA configuration from the initial server's configuration, regardless of whether the IdM CA on the server is a root CA or whether it is subordinated to an external CA.Note
For details on the supported CA configurations, see Section 2.3.2, “Determining What CA Configuration to Use”.
4.5.5. Installing a Replica from a Server without a CA
Important
- Run
ipa-replica-install, and provide the required certificate files by adding these options:--dirsrv-cert-file--dirsrv-pin--http-cert-file--http-pin
For details about the files that are provided using these options, see Section 2.3.6, “Installing Without a CA”.For example:[root@replica ~]# ipa-replica-install \ --dirsrv-cert-file /tmp/server.crt \ --dirsrv-cert-file /tmp/server.key \ --dirsrv-pin secret \ --http-cert-file /tmp/server.crt \ --http-cert-file /tmp/server.key \ --http-pin secretNote
Do not add the--ca-cert-fileoption. Theipa-replica-installutility takes this part of the certificate information automatically from the master server.
4.6. Testing the New Replica
- Create a user on one of the servers:
[admin@server1 ~]$ ipa user-add test_user --first=Test --last=User
- Make sure the user is visible on the other server:
[admin@server2 ~]$ ipa user-show test_user
4.7. Uninstalling a Replica
Part III. Administration: Managing Servers
Chapter 5. The Basics of Managing the IdM Server and Services
5.1. Starting and Stopping the IdM Server
ipactl utility to stop, start, or restart the entire IdM server along with all the installed services.
# ipactl start
# ipactl stop
# ipactl restart
systemctl utility, described in the System Administrator's Guide. For example, using systemctl to manage individual services is useful when customizing the Directory Server behavior: the configuration changes require restarting the Directory Server instance, but it is not necessary to restart all the IdM services.
Important
ipactl. Because of dependencies between the services installed with the IdM server, the order in which they are started and stopped is critical. The ipactl utility ensures that the services are started and stopped in the appropriate order.
5.2. Logging into IdM Using Kerberos
Using kinit
kinit utility.
Note
kinit, the krb5-workstation package must be installed.
kinit logs into IdM under the user name of the user that is currently logged-in on the local system. For example, if you are logged-in as local_user on the local system, running kinit attempts to authenticate you as the local_user IdM user:
[local_user@server ~]$ kinit Password for local_user@EXAMPLE.COM:
Note
kinit utility. For example, to log in as the admin user:
[local_user@server ~]$ kinit admin Password for admin@EXAMPLE.COM:
Obtaining Kerberos Tickets Automatically
pam_krb5 pluggable authentication module (PAM) and SSSD can be configured to automatically obtain a TGT for a user after a successful login in to the desktop environment on an IdM client machine. This ensures that after logging in, the user is not required to run kinit.
pam_krb5, see the pam_krb5(8) man page. For general information about PAM, see the System-Level Authentication Guide.
Storing Multiple Kerberos Tickets
kinit, Kerberos overwrites the currently-stored ticket with the new ticket. For example, if you use kinit to authenticate as user_A, the ticket for user_A will be lost after you authenticate again as user_B.
- Run the
export KRB5CCNAME=path_to_different_cachecommand, and then usekinitto obtain the ticket. - Run the
kinit -c path_to_different_cachecommand, and then reset theKRB5CCNAMEvariable.
- Run the
kdestroycommand. - Restore the default credential cache location using the
unset $KRB5CCNAMEcommand.
Checking the Current Logged-in User
klist utility to list cached tickets. In the following example, the cache contains a ticket for user_A, which means that only user_A is currently allowed to access IdM services:
$ klist
Ticket cache: KEYRING:persistent:0:0
Default principal: user_A@EXAMPLE.COM
Valid starting Expires Service principal
11/10/2015 08:35:45 11/10/2015 18:35:45 krbtgt/EXAMPLE.COM@EXAMPLE.COM
5.3. The IdM Command-Line Utilities
ipa. The ipa script is a parent script for a number of subcommands. These subcommands are then used to manage IdM. For example, the ipa user-add command adds a new user:
$ ipa user-add user_name
Note
ipa subcommands. More information is available in the other sections dedicated to specific areas of managing IdM. For example, for information about managing user entries using the ipa subcommands, see Chapter 11, Managing User Accounts.
5.3.1. Getting Help for ipa Commands
ipa script can display help about a particular set of subcommands: a topic. To display the list of available topics, use the ipa help topics command:
$ ipa help topics automember Auto Membership Rule. automount Automount caacl Manage CA ACL rules. ...
ipa help topic_name command. For example, to display information about the automember topic:
$ ipa help automember Auto Membership Rule. Bring clarity to the membership of hosts and users by configuring inclusive or exclusive regex patterns, you can automatically assign a new entries into a group or hostgroup based upon attribute information. ... EXAMPLES: Add the initial group or hostgroup: ipa hostgroup-add --desc="Web Servers" webservers ipa group-add --desc="Developers" devel ...
ipa script can also display a list of available ipa commands. To do this, use the ipa help commands command:
$ ipa help commands automember-add Add an automember rule. automember-add-condition Add conditions to an automember rule. ...
ipa commands, add the --help option to a command. For example:
$ ipa automember-add --help Usage: ipa [global-options] automember-add AUTOMEMBER-RULE [options] Add an automember rule. Options: -h, --help show this help message and exit --desc=STR A description of this auto member rule ...
ipa utility, see the ipa(1) man page.
5.3.2. Setting a List of Values
ipaUserSearchFields: uid,givenname,sn,telephonenumber,ou,title
- Using the same command-line argument multiple times within the same command invocation. For example:
$ ipa permission-add --permissions=read --permissions=write --permissions=delete - Enclosing the list in curly braces, which allows the shell to do the expansion. For example:
$ ipa permission-add --permissions={read,write,delete}
5.3.3. Using Special Characters
ipa commands that include special characters, such as angle brackets (< and >), ampersand (&), asterisk (*), or vertical bar (|), you must escape these characters by using a backslash (\). For example, to escape an asterisk (*):
$ ipa certprofile-show certificate_profile --out=exported\*profile.cfg5.3.4. Searching IdM Entries
Listing IdM Entries
ipa *-find commands to search for a particular type of IdM entries. For example:
- To list all users:
$ ipa user-find --------------- 4 users matched --------------- ...
- To list user groups whose specified attributes contain
keyword:$ ipa group-find keyword ---------------- 2 groups matched ---------------- ...
To configure the attributes IdM searches for users and user groups, see Section 13.5, “Setting Search Attributes for Users and User Groups”.
$ ipa group-find --user=user_name
$ ipa group-find --no-user=user_name
Showing Details for a Particular Entry
ipa *-show command to display details about a particular IdM entry. For example:
$ ipa host-show server.example.com Host name: server.example.com Principal name: host/server.example.com@EXAMPLE.COM ...
5.3.4.1. Adjusting the Search Size and Time Limit
ipa *-find commands, such as ipa user-find, and when displaying corresponding lists in the web UI.
- Defines the maximum number of entries returned for a request sent to the server from a client, the IdM command-line tools, or the IdM web UI.
- Default value: 100 entries.
- Defines the maximum time that the server waits for searches to run. Once the search reaches this limit, the server stops the search and returns the entries that discovered in that time.
- Default value: 2 seconds.
-1, IdM will not apply any limits when searching.
Important
Web UI: Adjusting the Search Size and Time Limit
- Select → .
- Set the required values in the Search Options area.
- Click at the top of the page.
Command Line: Adjusting the Search Size and Time Limit
ipa config-mod command and add the --searchrecordslimit and --searchtimelimit options. For example:
$ ipa config-mod --searchrecordslimit=500 --searchtimelimit=5
--sizelimit or --timelimit options to the command. For example:
$ ipa user-find --sizelimit=200 --timelimit=120
5.4. The IdM Web UI
ipa command-line utility. Therefore, the users can choose whether they want to manage IdM from the UI or from the command line.
Note
admin user and other users with administrative privileges, all management tasks are available. For regular users, only a limited set of operations related to their own user account is available.
5.4.1. Supported Web Browsers
- Mozilla Firefox 38 and later
- Google Chrome 46 and later
5.4.2. Accessing the Web UI and Authenticating
5.4.2.1. Accessing the Web UI
https://server.example.com

Figure 5.1. Web UI Login Screen
5.4.2.2. Available Login Methods
- With an active Kerberos ticket
- If the user has a valid TGT obtained with the
kinitutility, clicking automatically authenticates the user. Note that the browser must be configured properly to support Kerberos authentication.For information on obtaining a Kerberos TGT, see Section 5.2, “Logging into IdM Using Kerberos”. For information on configuring the browser, see Section 5.4.3, “Configuring the Browser for Kerberos Authentication”. - By providing user name and password
- To authenticate using a user name and password, enter the user name and password on the web UI login screen.IdM also supports one-time password (OTP) authentication. For more information, see Section 22.2, “One-Time Passwords”.
- With a smart card
- For more information, see Section 23.6, “Authenticating to the Identity Management Web UI with a Smart Card”.

Figure 5.2. The IdM Web UI Layout
5.4.2.3. Authenticating to the IdM Web UI as an AD User
[admin@server ~]$ ipa idoverrideuser-add 'Default Trust View' ad_user@ad.example.com5.4.3. Configuring the Browser for Kerberos Authentication

Figure 5.3. Kerberos Authentication Error
- Automatically from the IdM web UI. This option is only available for Firefox. See the section called “Automatic Firefox Configuration in the Web UI” for details.
- Automatically from the command line during the IdM client installation. This option is only available for Firefox. See the section called “Automatic Firefox Configuration from the Command Line” for details.
- Manually in the Firefox configuration settings. This option is available for all supported browsers. See the section called “Manual Browser Configuration” for details.
Note
Automatic Firefox Configuration in the Web UI
- Click the link for browser configuration on the web UI login screen.

Figure 5.4. Link to Configuring the Browser in the Web UI
- Choose the link for Firefox configuration to open the Firefox configuration page.

Figure 5.5. Link to the Firefox Configuration Page
- Follow the steps on the Firefox configuration page.
Automatic Firefox Configuration from the Command Line
--configure-firefox option when installing the IdM client with the ipa-client-install utility:
# ipa-client-install --configure-firefox
--configure-firefox option creates a global configuration file with default Firefox settings that enable Kerberos for single sign-on (SSO).
Manual Browser Configuration
- Click the link for browser configuration on the web UI login screen.

Figure 5.6. Link to Configuring the Browser in the Web UI
- Choose the link for manual browser configuration.

Figure 5.7. Link to the Manual Configuration Page
- Look for the instructions to configure your browser and follow the steps.
5.4.4. Configuring an External System for Kerberos Authentication to the Web UI
- Copy the
/etc/krb5.conffile from the IdM server to the external machine. For example:# scp /etc/krb5.conf root@externalmachine.example.com:/etc/krb5_ipa.conf
Warning
Do not overwrite the existingkrb5.conffile on the external machine. - On the external machine, set the terminal session to use the copied IdM Kerberos configuration file:
$ export KRB5_CONFIG=/etc/krb5_ipa.conf
- Configure the browser on the external machine as described in Section 5.4.3, “Configuring the Browser for Kerberos Authentication”.
kinit utility to authenticate against the IdM server domain.
5.4.5. Proxy Servers and Port Forwarding in the Web UI
-D option of the ssh utility; for more information on using -D, see the ssh(1) man page.
Chapter 6. Managing Replication Topology
Note
6.1. Explaining Replication Agreements, Topology Suffixes, and Topology Segments
Replication Agreements
Note
Topology Suffixes
domain and ca. Each suffix represents a separate back end, a separate replication topology.
- The
domainsuffix: dc=example,dc=com - The
domainsuffix contains all domain-related data.When two replicas have a replication agreement between theirdomainsuffixes, they share directory data, such as users, groups, and policies. - The
casuffix: o=ipaca - The
casuffix contains data for the Certificate System component. It is only present on servers with a certificate authority (CA) installed.When two replicas have a replication agreement between theircasuffixes, they share certificate data.

Figure 6.1. Topology Suffixes
ipa-replica-install script when installing a new replica.
Example 6.1. Viewing Topology Suffixes
ipa topologysuffix-find command displays a list of topology suffixes:
$ ipa topologysuffix-find --------------------------- 2 topology suffixes matched --------------------------- Suffix name: ca Managed LDAP suffix DN: o=ipaca Suffix name: domain Managed LDAP suffix DN: dc=example,dc=com ---------------------------- Number of entries returned 2 ----------------------------
Topology Segments

Figure 6.2. Topology Segments
Example 6.2. Viewing Topology Segments
ipa topologysegment-find command shows the current topology segments configured for the domain or CA suffixes. For example, for the domain suffix:
$ ipa topologysegment-find Suffix name: domain ----------------- 1 segment matched ----------------- Segment name: server1.example.com-to-server2.example.com Left node: server1.example.com Right node: server2.example.com Connectivity: both ---------------------------- Number of entries returned 1 ----------------------------
server1.example.com and server1.example.com.
ipa topologysegment-show command:
$ ipa topologysegment-show Suffix name: domain Segment name: server1.example.com-to-server2.example.com Segment name: server1.example.com-to-server2.example.com Left node: server1.example.com Right node: server2.example.com Connectivity: both
6.2. Web UI: Using the Topology Graph to Manage Replication Topology
Accessing the Topology Graph
- Select → → .
- If you make any changes to the topology that are not immediately reflected in the graph, click .
Customizing the Topology View

Figure 6.3. Moving Topology Graph Nodes

Figure 6.4. Zooming the Topology Graph

Figure 6.5. Moving the Topology Graph Canvas
Interpreting the Topology Graph
- Topology graph example: recommended topology
- Figure 6.6, “Recommended Topology Example” shows one of the possible recommended topologies for four servers: each server is connected to at least two other servers, and more than one server is a CA master.

Figure 6.6. Recommended Topology Example
- Topology graph example: discouraged topology
- In Figure 6.7, “Discouraged Topology Example: Single Point of Failure”,
server1is a single point of failure. All the other servers have replication agreements with this server, but not with any of the other servers. Therefore, ifserver1fails, all the other servers will become isolated.Avoid creating topologies like this.
Figure 6.7. Discouraged Topology Example: Single Point of Failure
6.2.1. Setting up Replication Between Two Servers
- In the topology graph, hover your mouse over one of the server nodes.

Figure 6.8. Domain or CA Options
- Click on the domain or the ca part of the circle depending on what type of topology segment you want to create.
- A new arrow representing the new replication agreement appears under your mouse pointer. Move your mouse to the other server node, and click on it.

Figure 6.9. Creating a New Segment
- In the Add Topology Segment window, click to confirm the properties of the new segment.

Figure 6.10. New Segment Created
6.2.2. Stopping Replication Between Two Servers
- Click on an arrow representing the replication agreement you want to remove. This highlights the arrow.

Figure 6.11. Topology Segment Highlighted
- Click .
- In the Confirmation window, click .

Figure 6.12. Topology Segment Deleted
6.3. Command Line: Managing Topology Using the ipa topology* Commands
6.3.1. Getting Help for Topology Management Commands
$ ipa help topology
--help option:
$ ipa topologysuffix-show --help
6.3.2. Setting up Replication Between Two Servers
- Use the
ipa topologysegment-addcommand to create a topology segment for the two servers. When prompted, provide:- the required topology suffix:
domainorcaNote
If you want to create a segment betweencasuffixes, both servers must have a CA installed. See Section 26.8, “Installing a CA Into an Existing IdM Domain”. - the left node and the right node, representing the two servers
- optionally, a custom name for the segment
For example:$ ipa topologysegment-add Suffix name: domain Left node: server1.example.com Right node: server2.example.com Segment name [server1.example.com-to-server2.example.com]: new_segment --------------------------- Added segment "new_segment" --------------------------- Segment name: new_segment Left node: server1.example.com Right node: server2.example.com Connectivity: both
Adding the new segment joins the servers in a replication agreement. - Optional. Use the
ipa topologysegment-showcommand to verify that the new segment is configured.$ ipa topologysegment-show Suffix name: domain Segment name: new_segment Segment name: new_segment Left node: server1.example.com Right node: server2.example.com Connectivity: both
6.3.3. Stopping Replication Between Two Servers
- To stop replication, you must delete the corresponding replication segment between the servers. To do that, you need to know the segment name.If you do not know the name, use the
ipa topologysegment-findcommand to display all segments, and locate the required segment in the output. When prompted, provide the required topology suffix:domainorca. For example:$ ipa topologysegment-find Suffix name: domain ------------------ 8 segments matched ------------------ Segment name: new_segment Left node: server1.example.com Right node: server2.example.com Connectivity: both ... ---------------------------- Number of entries returned 8 ---------------------------- - Use the
ipa topologysegment-delcommand to remove the topology segment joining the two servers.$ ipa topologysegment-del Suffix name: domain Segment name: new_segment ----------------------------- Deleted segment "new_segment" -----------------------------
Deleting the segment removes the replication agreement. - Optional. Use the
ipa topologysegment-findcommand to verify that the segment is no longer listed.$ ipa topologysegment-find Suffix name: domain ------------------ 7 segments matched ------------------ Segment name: server2.example.com-to-server3.example.com Left node: server2.example.com Right node: server3.example.com Connectivity: both ... ---------------------------- Number of entries returned 7 ----------------------------
6.4. Removing a Server from the Topology
- the server being removed is the only server connecting other servers with the rest of the topology; this would cause the other servers to become isolated, which is not allowed
- the server being removed is your last CA or DNS server
$ ipa server-del
Server name: server1.example.com
Removing server1.example.com from replication topology, please wait...
ipa: ERROR: Server removal aborted:
Removal of 'server1.example.com' leads to disconnected topology in suffix 'domain':
Topology does not allow server server2.example.com to replicate with servers:
server3.example.com
server4.example.com
...6.4.1. Web UI: Removing a Server from the Topology
- Select → → .
- Click on the name of the server you want to delete.

Figure 6.13. Selecting a Server
- Click .
6.4.2. Command Line: Removing a Server from the Topology
Important
server1.example.com:
- On another server, run the
ipa server-delcommand to removeserver1.example.com. The command removes all topology segments pointing to the server:[user@server2 ~]$ ipa server-del Server name: server1.example.com Removing server1.example.com from replication topology, please wait... ---------------------------------------------------------- Deleted IPA server "server1.example.com" ----------------------------------------------------------
- On
server1.example.com, run theipa server-install --uninstallcommand to uninstall the server components from the machine.[root@server1 ~]# ipa server-install --uninstall
6.5. Managing Server Roles
6.5.1. Viewing Server Roles
Web UI: Viewing Server Roles
- Role status absent means that no server in the topology is performing the role.
- Role status enabled means that one or more servers in the topology are performing the role.

Figure 6.14. Server Roles in the Web UI
Command Line: Viewing Server Roles
ipa config-show command displays all CA servers, NTP servers, and the current CA renewal master:
$ ipa config-show ... IPA masters: server1.example.com, server2.example.com, server3.example.com IPA CA servers: server1.example.com, server2.example.com IPA NTP servers: server1.example.com, server2.example.com, server3.example.com IPA CA renewal master: server1.example.com
ipa server-show command displays a list of roles enabled on a particular server. For example, for a list of roles enabled on server.example.com:
$ ipa server-show
Server name: server.example.com
...
Enabled server roles: CA server, DNS server, NTP server, KRA serveripa server-find --servrole searches for all servers with a particular server role enabled. For example, to search for all CA servers:
$ ipa server-find --servrole "CA server" --------------------- 2 IPA servers matched --------------------- Server name: server1.example.com ... Server name: server2.example.com ... ---------------------------- Number of entries returned 2 ----------------------------
6.5.2. Promoting a Replica to a Master CA Server
Note
- Configure the replica to handle CA subsystem certificate renewal.
- See Section 6.5.2.1, “Changing the Current CA Renewal Master” for domain level 1.
- See Section D.4.1, “Changing Which Server Handles Certificate Renewal” for domain level 0.
- Configure the replica to generate CRLs. See Section 6.5.2.2, “Changing Which Server Generates CRLs”.
- Before decommissioning the previous master CA server, make sure the new master works properly. See Section 6.5.2.3, “Verifying That the New Master CA Server Is Configured Correctly”.
6.5.2.1. Changing the Current CA Renewal Master
Web UI: Changing the Current CA Renewal Master
- Select → .
- In the IPA CA renewal master field, select the new CA renewal master.
Command Line: Changing the Current CA Renewal Master
ipa config-mod --ca-renewal-master-server command:
$ ipa config-mod --ca-renewal-master-server new_ca_renewal_master.example.com
...
IPA masters: old_ca_renewal_master.example.com, new_ca_renewal_master.example.com
IPA CA servers: old_ca_renewal_master.example.com, new_ca_renewal_master.example.com
IPA NTP servers: old_ca_renewal_master.example.com, new_ca_renewal_master.example.com
IPA CA renewal master: new_ca_renewal_master.example.com6.5.2.2. Changing Which Server Generates CRLs
Identifying the Current CRL Generation Master
/etc/pki/pki-tomcat/ca/CS.cfg file on each server with a CA installed:
- On the CRL generation master, the
ca.crl.MasterCRL.enableCRLUpdatesparameter is set totrue:# grep ca.crl.MasterCRL.enableCRLUpdates /etc/pki/pki-tomcat/ca/CS.cfg ca.crl.MasterCRL.enableCRLUpdates=true - On CRL generation clones, the parameter is set to
false.
Stopping CRL Generation on the Current CRL Generation Master
- Stop the CA service:
# systemctl stop pki-tomcatd@pki-tomcat.service
- Disable CRL generation on the server. Open the
/etc/pki/pki-tomcat/ca/CS.cfgfile, and set the values of theca.crl.MasterCRL.enableCRLCacheandca.crl.MasterCRL.enableCRLUpdatesparameters tofalse:ca.crl.MasterCRL.enableCRLCache=
falseca.crl.MasterCRL.enableCRLUpdates=false - Start the CA service:
# systemctl start pki-tomcatd@pki-tomcat.service
- Configure Apache to redirect CRL requests to the new master. Open the
/etc/httpd/conf.d/ipa-pki-proxy.conffile, and uncomment theRewriteRuleargument:# Only enable this on servers that are not generating a CRL RewriteRule ^/ipa/crl/MasterCRL.bin https://server.example.com/ca/ee/ca/getCRL?op=getCRL&crlIssuingPoint=MasterCRL [L,R=301,NC]
- Restart Apache:
# systemctl restart httpd.service
Configure a Server to Generate CRLs
- Stop the CA service:
# systemctl stop pki-tomcatd@pki-tomcat.service
- Enable CRL generation on the server. Set the values of the
ca.crl.MasterCRL.enableCRLCacheandca.crl.MasterCRL.enableCRLUpdatesparameters totrue:ca.crl.MasterCRL.enableCRLCache=true ca.crl.MasterCRL.enableCRLUpdates=true
- Start the CA service:
# systemctl start pki-tomcatd@pki-tomcat.service
- Configure Apache to disable redirecting CRL requests. Open the
/etc/httpd/conf.d/ipa-pki-proxy.conffile, and comment out theRewriteRuleargument:#RewriteRule ^/ipa/crl/MasterCRL.bin https://server.example.com/ca/ee/ca/getCRL?op=getCRL&crlIssuingPoint=MasterCRL [L,R=301,NC]Before, all CRL requests were routed to the previous CA master. Now, this server will respond to CRL requests. - Restart Apache:
# systemctl restart httpd.service
6.5.2.3. Verifying That the New Master CA Server Is Configured Correctly
/var/lib/ipa/pki-ca/publish/MasterCRL.bin file exists on the new master CA server.
/etc/pki/pki-tomcat/ca/CS.cfg file using the ca.crl.MasterCRL.autoUpdateInterval parameter. The default value is 240 minutes (4 hours).
Chapter 7. Displaying and Raising the Domain Level
- Domain level 1
- Examples of available functionality:
- simplified
ipa-replica-install(see Section 4.5, “Creating the Replica: Introduction”) - enhanced topology management (see Chapter 6, Managing Replication Topology)
Important
Domain level 1 was introduced in Red Hat Enterprise Linux 7.3 with IdM version 4.4. To use the domain level 1 features, all your replicas must be running Red Hat Enterprise Linux 7.3 or later.If your first server was installed with Red Hat Enterprise Linux 7.3, the domain level for your domain is automatically set to 1.If you upgrade all servers to IdM version 4.4 from earlier versions, the domain level is not raised automatically. If you want to use domain level 1 features, raise the domain level manually, as described in Section 7.2, “Raising the Domain Level”. - Domain level 0
- Examples of available functionality:
ipa-replica-installrequires a more complicated process of creating a replica information file on the initial server and copying it to the replica (see Section D.2, “Creating Replicas”)- more complicated and error-prone topology management using
ipa-replica-manageandipa-csreplica-manage(see Section D.3, “Managing Replicas and Replication Agreements”)
7.1. Displaying the Current Domain Level
Command Line: Displaying the Current Domain Level
- Log in as the administrator:
$ kinit admin
- Run the
ipa domainlevel-getcommand:$ ipa domainlevel-get ----------------------- Current domain level: 0 -----------------------
Web UI: Displaying the Current Domain Level
7.2. Raising the Domain Level
Important
0 to 1, you cannot downgrade from 1 to 0 again.
Command Line: Raising the Domain Level
- Log in as the administrator:
$ kinit admin
- Run the
ipa domainlevel-setcommand and provide the required level:$ ipa domainlevel-set 1 ----------------------- Current domain level: 1 -----------------------
Web UI: Raising the Domain Level
- Select → .
- Click .
Chapter 8. Updating and Migrating Identity Management
8.1. Updating Identity Management
yum utility to update the Identity Management packages on the system.
yum upgrades the Identity Management server or client to this version.
Note
8.1.1. Considerations for Updating Identity Management
- After you update the Identity Management packages on at least one server, all other servers in the topology receive the updated schema, even if you do not update their packages. This ensures that any new entries which use the new schema can be replicated among the other servers.
- Downgrading Identity Management packages is not supported.
Important
Do not run theyum downgradecommand on any of the ipa-* packages. - Red Hat recommends upgrading to the next version only. For example, if you want to upgrade to Identity Management for Red Hat Enterprise Linux 7.4, we recommend upgrading from Identity Management for Red Hat Enterprise Linux 7.3. Upgrading from earlier versions can cause problems.
8.1.2. Using yum to Update the Identity Management Packages
# yum update ipa-*Warning
Related Information
- For details on using the
yumutility, see Yum in the System Administrator's Guide.
Important
mod_nss module. You can ensure that by following these steps:
- Edit the
/etc/httpd/conf.d/nss.conffile and set theNSSProtocolparameter toTLSv1.0(for backward compatibility),TLSv1.1, andTLSv1.2.NSSProtocol TLSv1.0,TLSv1.1,TLSv1.2
- Restart the
httpdservice.# systemctl restart httpd.service
yum update ipa-* command is launched to upgrade the main packages.
8.2. Migrating Identity Management from Red Hat Enterprise Linux 6 to Version 7
- Migrating the Red Hat Enterprise Linux 6-based certificate authority (CA) master server to Red Hat Enterprise Linux 7.
- Transitioning all services to the new Red Hat Enterprise Linux 7 server. These services include CRL and certificate creating, DNS management, or Kerberos KDC administration.
- Decommissioning the original Red Hat Enterprise Linux 6 CA master.
rhel7.example.comis the Red Hat Enterprise Linux 7 system that will become the new CA master.rhel6.example.comis the original Red Hat Enterprise Linux 6 CA master.Note
To identify which Red Hat Enterprise Linux 6 server is the master CA server, determine on which server thecertmongerservice tracks therenew_ca_certcommand. Run this command on every Red Hat Enterprise Linux 6 server:[root@rhel6 ~]#
getcert list -d /var/lib/pki-ca/alias -n "subsystemCert cert-pki-ca" | grep post-savepost-save command: /usr/lib64/ipa/certmonger/renew_ca_cert "subsystemCert cert-pki-ca"The post-save action that executesrenew_ca_certis defined only for the CA master.
8.2.1. Prerequisites for Migrating Identity Management from Red Hat Enterprise Linux 6 to 7
- Update the
rhel6.example.comsystem to the latest Red Hat Enterprise Linux 6 version. - On the
rhel6.example.comsystem, upgrade the ipa-* packages:[root@rhel6 ~]#
yum update ipa-*This step also makes sure that you have applied the RHBA-2015:0231-2 advisory, which provides the2.3-6.el6_6version of the bind-dyndb-ldap package and is available with the Red Hat Enterprise Linux 6.6 Extended Update Support (EUS).Warning
Using an earlier version of bind-dyndb-ldap results in inconsistent behavior in DNS forward zones serving between the Red Hat Enterprise Linux 6.6 DNS servers and Red Hat Enterprise Linux 7 DNS servers. - Make sure the
rhel7.example.comsystem meets the requirements in Section 2.1, “Prerequisites for Installing a Server” and Section 4.3, “Prerequisites for Installing a Replica”. - On the
rhel7.example.comsystem, install the required packages. See Section 2.2, “Packages Required to Install an IdM Server”.
8.2.2. Updating the Identity Management Schema on Red Hat Enterprise Linux 6
copy-schema-to-ca.py schema update script prepares rhel6.example.com for the installation of the rhel7.example.com replica. Updating the schema is necessary due to schema changes between Identity Management version 3.1 and later versions.
- Copy the
copy-schema-to-ca.pyschema update script from therhel7.example.comsystem to therhel6.example.comsystem. For example:[root@rhel7 ~]#
scp /usr/share/ipa/copy-schema-to-ca.py root@rhel6:/root/ - Run the updated
copy-schema-to-ca.pyscript onrhel6.example.com.[root@rhel6 ~]#
python copy-schema-to-ca.pyipa : INFO Installed /etc/dirsrv/slapd-PKI-IPA//schema/60kerberos.ldif [... output truncated ...] ipa : INFO Schema updated successfully
8.2.3. Installing the Red Hat Enterprise Linux 7 Replica
- On the
rhel6.example.comsystem, create the replica file you will use to install therhel7.example.comreplica. For example, to create a replica file forrhel7.example.comwhose IP address is192.0.2.1:[root@rhel6 ~]#
ipa-replica-prepare rhel7.example.com --ip-address 192.0.2.1Directory Manager (existing master) password: Preparing replica for rhel7.example.com from rhel6.example.com [... output truncated ...] The ipa-replica-prepare command was successful - Copy the replica information file from
rhel6.example.comtorhel7.example.com.[root@rhel6 ~]#
scp /var/lib/ipa/replica-info-replica.example.com.gpg root@rhel7:/var/lib/ipa/ - Install the
rhel7.example.comreplica using the replica file. For example, the following command uses these options:--setup-cato set up the Certificate System component--setup-dnsand--forwarderto configure an integrated DNS server and set a forwarder--ip-addressto specify the IP address of therhel7.example.comsystem
[root@rhel7 ~]#
ipa-replica-install /var/lib/ipa/replica-info-rhel7.example.com.gpg --setup-ca --ip-address 192.0.2.1 --setup-dns --forwarder 192.0.2.20Directory Manager (existing master) password: Checking DNS forwarders, please wait ... Run connection check to master [... output truncated ...] Client configuration complete.See also:- Section D.2, “Creating Replicas”, which describes creating replicas using replica information files
- Verify that the Identity Management services are running on
rhel7.example.com.[root@rhel7 ~]#
ipactl statusDirectory Service: RUNNING [... output truncated ...] ipa: INFO: The ipactl command was successful
8.2.4. Transitioning the CA Services to the Red Hat Enterprise Linux 7 Server
- Verify that
rhel6.example.comandrhel7.example.comCAs are both configured as master servers.[root@rhel7 ~]$
kinit admin[root@rhel7 ~]$ipa-csreplica-manage listrhel6.example.com: master rhel7.example.com: masterTo display details about a replication agreement:[root@rhel7 ~]#
ipa-csreplica-manage list --verbose rhel7.example.comrhel7.example.com last init status: None last init ended: 1970-01-01 00:00:00+00:00 last update status: Error (0) Replica acquired successfully: Incremental update succeeded last update ended: 2017-02-13 13:55:13+00:00
rhel6.example.com original master CA, stop the CA subsystem certificate renewal:
- Disable tracking for the original CA certificates.
[root@rhel6 ~]#
getcert stop-tracking -d /var/lib/pki-ca/alias -n "auditSigningCert cert-pki-ca"Request "20181127184547" removed. [root@rhel6 ~]#getcert stop-tracking -d /var/lib/pki-ca/alias -n "ocspSigningCert cert-pki-ca"Request "20181127184548" removed. [root@rhel6 ~]#getcert stop-tracking -d /var/lib/pki-ca/alias -n "subsystemCert cert-pki-ca"Request "20181127184549" removed. [root@rhel6 ~]#getcert stop-tracking -d /etc/httpd/alias -n ipaCertRequest "20181127184550" removed. - Reconfigure
rhel6.example.comto retrieve renewed certificates from a new master CA.- Copy the renewal helper script into the
certmongerservice directory, and set the appropriate permissions.[root@rhel6 ~]#
cp /usr/share/ipa/ca_renewal /var/lib/certmonger/cas/[root@rhel6 ~]#chmod 0600 /var/lib/certmonger/cas/ca_renewal - Update the SELinux configuration.
[root@rhel6 ~]#
restorecon /var/lib/certmonger/cas/ca_renewal - Restart
certmonger.[root@rhel6 ~]#
service certmonger restart - Check that the CA is listed to retrieve certificates.
[root@rhel6 ~]#
getcert list-cas... CA 'dogtag-ipa-retrieve-agent-submit': is-default: no ca-type: EXTERNAL helper-location: /usr/libexec/certmonger/dogtag-ipa-retrieve-agent-submit - Obtain the CA certificate database PIN.
[root@rhel6 ~]#
grep internal= /var/lib/pki-ca/conf/password.conf - Configure
certmongerto track the certificates for external renewal. This requires the database PIN.[root@rhel6 ~]#
getcert start-tracking \-c dogtag-ipa-retrieve-agent-submit \-d /var/lib/pki-ca/alias \-n "auditSigningCert cert-pki-ca" \-B /usr/lib64/ipa/certmonger/stop_pkicad \-C '/usr/lib64/ipa/certmonger/restart_pkicad \"auditSigningCert cert-pki-ca"' \-T "auditSigningCert cert-pki-ca" \-P database_pinNew tracking request "20181127184743" added. [root@rhel6 ~]#getcert start-tracking \-c dogtag-ipa-retrieve-agent-submit \-d /var/lib/pki-ca/alias \-n "ocspSigningCert cert-pki-ca" \-B /usr/lib64/ipa/certmonger/stop_pkicad \-C '/usr/lib64/ipa/certmonger/restart_pkicad \"ocspSigningCert cert-pki-ca"' \-T "ocspSigningCert cert-pki-ca" \-P database_pinNew tracking request "20181127184744" added. [root@rhel6 ~]#getcert start-tracking \-c dogtag-ipa-retrieve-agent-submit \-d /var/lib/pki-ca/alias \-n "subsystemCert cert-pki-ca" \-B /usr/lib64/ipa/certmonger/stop_pkicad \-C '/usr/lib64/ipa/certmonger/restart_pkicad \"subsystemCert cert-pki-ca"' \-T "subsystemCert cert-pki-ca" \-P database_pinNew tracking request "20181127184745" added. [root@rhel6 ~]#getcert start-tracking \-c dogtag-ipa-retrieve-agent-submit \-d /etc/httpd/alias \-n ipaCert \-C /usr/lib64/ipa/certmonger/restart_httpd \-T ipaCert \-p /etc/httpd/alias/pwdfile.txtNew tracking request "20181127184746" added.
rhel6.example.com CA master to rhel7.example.com.
- On
rhel6.example.com, stop CRL generation:- Stop the CA service.
[root@rhel6 ~]#
service pki-cad stop - Disable CRL generation on
rhel6.example.com. Open the/var/lib/pki-ca/conf/CS.cfgfile, and set the values of theca.crl.MasterCRL.enableCRLCacheandca.crl.MasterCRL.enableCRLUpdatesparameters tofalse.ca.crl.MasterCRL.enableCRLCache=
falseca.crl.MasterCRL.enableCRLUpdates=false - Start the CA service.
[root@rhel6 ~]#
service pki-cad start
- On
rhel6.example.com, configure Apache to redirect CRL requests to the new master,rhel7.example.com.- Open the
/etc/httpd/conf.d/ipa-pki-proxy.conffile. Uncomment theRewriteRuleargument, and replace the server host name with therhel7.example.comhost name in the server URL:RewriteRule ^/ipa/crl/MasterCRL.bin https://rhel7.example.com/ca/ee/ca/getCRL?op=getCRL&crlIssuingPoint=MasterCRL [L,R=301,NC]
- Restart Apache.
[root@rhel6 ~]#
service httpd restart
- On
rhel7.example.com, configurerhel7.example.comas the new CA master:- Configure
rhel7.example.comto handle CA subsystem certificate renewal, as described in Section D.4.1, “Changing Which Server Handles Certificate Renewal”. - Configure
rhel7.example.comto general certificate revocation lists (CRLs), as described in the section called “Configure a Server to Generate CRLs”.
Related Information
- See Section 6.5.2, “Promoting a Replica to a Master CA Server” for details on CA subsystem certificate renewal and CRLs.
8.2.5. Stop the Red Hat Enterprise Linux 6 Server
rhel6.example.com to force domain discovery to the new rhel7.example.com server.
[root@rhel6 ~]# ipactl stop
Stopping CA Service
Stopping pki-ca: [ OK ]
Stopping HTTP Service
Stopping httpd: [ OK ]
Stopping MEMCACHE Service
Stopping ipa_memcached: [ OK ]
Stopping DNS Service
Stopping named: . [ OK ]
Stopping KPASSWD Service
Stopping Kerberos 5 Admin Server: [ OK ]
Stopping KDC Service
Stopping Kerberos 5 KDC: [ OK ]
Stopping Directory Service
Shutting down dirsrv:
EXAMPLE-COM... [ OK ]
PKI-IPA... [ OK ]ipa utility will contact the new server through a remote procedure call (RPC).
8.2.6. Next Steps After Migrating the Master CA Server
- Create a replica file from
rhel7.example.com.Note
After installing a Red Hat Enterprise Linux 7 replica from a Red Hat Enterprise Linux 6 server, the domain level for the Identity Management domain is automatically set to 0.Red Hat Enterprise Linux 7.3 introduced an easier way to install and manage replicas. To use these features, your topology must be at domain level 1. See Chapter 7, Displaying and Raising the Domain Level. - Use the replica file to install a new replica on another Red Hat Enterprise Linux 7 system.
- Remove the server from the topology by executing the removal commands on a Red Hat Enterprise Linux 7 server.
Chapter 9. Backing Up and Restoring Identity Management
Important
- Catastrophic hardware failure on a machine occurs and the machine becomes incapable of further functioning. In this situation, you can reinstall the operating system from scratch, configure the machine with the same fully qualified domain name (FQDN) and host name, install the IdM packages as well as all other optional packages relating to IdM that were present on the original system, and restore the full backup of the IdM server.
- An upgrade on an isolated machine fails. The operating system remains functional, but the IdM data is corrupted, which is why you want to restore the IdM system to a known good state.
Important
In cases of hardware or upgrade failure, such as the two mentioned above, restore from backup only if all replicas or a replica with a special role, such as the only certificate authority (CA), were lost. If a replica with the same data still exists, it is recommended to delete the lost replica and then rebuild it from the remaining one. - Undesirable changes were made to the LDAP content, for example entries were deleted, and you want to revert them. Restoring backed-up LDAP data returns the LDAP entries to the previous state without affecting the IdM system itself.
9.1. Full-Server Backup and Data-Only Backup
- Full-IdM server backup
- Full-server backup creates a backup copy of all the IdM server files as well as LDAP data, which makes it a standalone backup. IdM affects hundreds of files; the files that the backup process copies is a mix of whole directories and specific files, such as configuration files or log files, and relate directly to IdM or to various services that IdM depends on. Because the full-server backup is a raw file backup, it is performed offline. The script that performs the full-server backup stops all IdM services to ensure a safe course of the backup process.For the full list of files and directories that the full-server backup copies, see Section 9.1.3, “List of Directories and Files Copied During Backup”.
- Data-only Backup
- The data-only backup only creates a backup copy of LDAP data and the changelog. The process backs up the
IPA-REALMinstance and can also back up multiple back ends or only a single back end; the back ends include theIPAback end and theCA Dogtagback end. This type of backup also backs up a record of the LDAP content stored in LDIF (LDAP Data Interchange Format). The data-only backup can be performed both online and offline.
/var/lib/ipa/backup/ directory. The naming conventions for the subdirectories containing the backups are:
ipa-full-YEAR-MM-DD-HH-MM-SSin the GMT time zone for the full-server backupipa-data-YEAR-MM-DD-HH-MM-SSin the GMT time zone for the data-only backup
9.1.1. Creating a Backup
ipa-backup utility which must always be run as root.
ipa-backup.
Important
ipa-backup --data command.
ipa-backup:
--onlineperforms an online backup; this option is only available with data-only backups--logsincludes the IdM service log files in the backup
/tmp directory, change the location of the staged files to be created during the backup by using the TMPDIR environment variable:
# TMPDIR=/path/to/backup ipa-backupipa-backup, see the ipa-backup(1) man page.
9.1.2. Encrypting Backup
- Create a
keygenfile containing the key details, for example, by runningcat >keygen <<EOFand providing the required encryption details to the file from the command line:[root@server ~]# cat >keygen <<EOF > %echo Generating a standard key > Key-Type: RSA > Key-Length:2048 > Name-Real: IPA Backup > Name-Comment: IPA Backup > Name-Email: root@example.com > Expire-Date: 0 > %pubring /root/backup.pub > %secring /root/backup.sec > %commit > %echo done > EOF [root@server ~]#
- Generate a new key pair called
backupand feed the contents ofkeygento the command. The following example generates a key pair with the path names/root/backup.secand/root/backup.pub:[root@server ~]# gpg --batch --gen-key keygen [root@server ~]# gpg --no-default-keyring --secret-keyring /root/backup.sec \ --keyring /root/backup.pub --list-secret-keys
backup key to ipa-backup by supplying the following options:
--gpg, which instructsipa-backupto perform the encrypted backup--gpg-keyring=GPG_KEYRING, which provides the full path to the GPG keyring without the file extension.
[root@server ~]# ipa-backup --gpg --gpg-keyring=/root/backup
Note
gpg2 utility to generate GPG keys because gpg2 requires an external program to function. To generate the key purely from console in this situation, add the pinentry-program /usr/bin/pinentry-curses line to the .gnupg/gpg-agent.conf file before generating a key.
9.1.3. List of Directories and Files Copied During Backup
/usr/share/ipa/html /root/.pki /etc/pki-ca /etc/pki/pki-tomcat /etc/sysconfig/pki /etc/httpd/alias /var/lib/pki /var/lib/pki-ca /var/lib/ipa/sysrestore /var/lib/ipa-client/sysrestore /var/lib/ipa/dnssec /var/lib/sss/pubconf/krb5.include.d/ /var/lib/authconfig/last /var/lib/certmonger /var/lib/ipa /var/run/dirsrv /var/lock/dirsrv
/etc/named.conf /etc/named.keytab /etc/resolv.conf /etc/sysconfig/pki-ca /etc/sysconfig/pki-tomcat /etc/sysconfig/dirsrv /etc/sysconfig/ntpd /etc/sysconfig/krb5kdc /etc/sysconfig/pki/ca/pki-ca /etc/sysconfig/ipa-dnskeysyncd /etc/sysconfig/ipa-ods-exporter /etc/sysconfig/named /etc/sysconfig/ods /etc/sysconfig/authconfig /etc/ipa/nssdb/pwdfile.txt /etc/pki/ca-trust/source/ipa.p11-kit /etc/pki/ca-trust/source/anchors/ipa-ca.crt /etc/nsswitch.conf /etc/krb5.keytab /etc/sssd/sssd.conf /etc/openldap/ldap.conf /etc/security/limits.conf /etc/httpd/conf/password.conf /etc/httpd/conf/ipa.keytab /etc/httpd/conf.d/ipa-pki-proxy.conf /etc/httpd/conf.d/ipa-rewrite.conf /etc/httpd/conf.d/nss.conf /etc/httpd/conf.d/ipa.conf /etc/ssh/sshd_config /etc/ssh/ssh_config /etc/krb5.conf /etc/ipa/ca.crt /etc/ipa/default.conf /etc/dirsrv/ds.keytab /etc/ntp.conf /etc/samba/smb.conf /etc/samba/samba.keytab /root/ca-agent.p12 /root/cacert.p12 /var/kerberos/krb5kdc/kdc.conf /etc/systemd/system/multi-user.target.wants/ipa.service /etc/systemd/system/multi-user.target.wants/sssd.service /etc/systemd/system/multi-user.target.wants/certmonger.service /etc/systemd/system/pki-tomcatd.target.wants/pki-tomcatd@pki-tomcat.service /var/run/ipa/services.list /etc/opendnssec/conf.xml /etc/opendnssec/kasp.xml /etc/ipa/dnssec/softhsm2.conf /etc/ipa/dnssec/softhsm_pin_so /etc/ipa/dnssec/ipa-ods-exporter.keytab /etc/ipa/dnssec/ipa-dnskeysyncd.keytab /etc/idm/nssdb/cert8.db /etc/idm/nssdb/key3.db /etc/idm/nssdb/secmod.db /etc/ipa/nssdb/cert8.db /etc/ipa/nssdb/key3.db /etc/ipa/nssdb/secmod.db
/var/log/pki-ca /var/log/pki/ /var/log/dirsrv/slapd-PKI-IPA /var/log/httpd /var/log/ipaserver-install.log /var/log/kadmind.log /var/log/pki-ca-install.log /var/log/messages /var/log/ipaclient-install.log /var/log/secure /var/log/ipaserver-uninstall.log /var/log/pki-ca-uninstall.log /var/log/ipaclient-uninstall.log /var/named/data/named.run
9.2. Restoring a Backup
ipa-backup, you can restore your IdM server or the LDAP content to the state in which they were when the backup was performed. You cannot restore a backup on a host different from the host on which the backup was originally created.
Note
9.2.1. Restoring from the Full-Server or Data-Only Backup
Important
ipa-restore utility which must always be run as root. Pass the backup to the command:
- Pass only the name of the directory with the backup if it is located in the default
/var/lib/ipa/backup/directory. - Pass the full path to the backup if the directory containing the backup is not located in the default directory. For example:
[root@server ~]# ipa-restore /path/to/backup
ipa-restore utility automatically detects what type of backup the backup directory contains and by default performs the same type of restore.
ipa-restore:
--dataperforms a data-only restore from a full-server backup, that is, restores only the LDAP data component from a backup directory containing the full-server backup--onlinerestores the LDAP data in a data-only restore online--instancespecifies which 389 DS instance is restored. IdM in Red Hat Enterprise Linux 7 only uses theIPA-REALMinstance, but it might be possible, for example, to create a backup on a system with separate instances; in such cases,--instanceallows you to restore onlyIPA-REALM. For example:[root@server ~]# ipa-restore --instance=IPA-REALM /path/to/backup
You can use this option only when performing a data-only restore.--backendspecifies which back end is restored; without this option,ipa-restorerestores all back ends it discovers. The arguments defining the possible back ends areuserRoot, which restores the IPA data back end, andipaca, which restores the CA back end.You can use this option only when performing a data-only restore.--no-logsrestores the backup without restoring the log files
- Stop the SSSD service:
[root@server ~]# systemctl stop sssd
- Remove all cached content from SSSD:
[root@server ~]# find /var/lib/sss/ ! -type d | xargs rm -f
- Start the SSSD service:
[root@server ~]# systemctl start sssd
Note
ipa-restore, see the ipa-restore(1) man page.
9.2.2. Restoring with Multiple Master Servers
ipa-replica-manage command and, on masters that have a CA installed, the ipa-csreplica-manage command. For example:
[root@server ~]# ipa-replica-manage re-initialize --from=restored_master_FQDN
9.2.3. Restoring from an Encrypted Backup
--gpg-keyring option. For example:
[root@server ~]# ipa-restore --gpg-keyring=/root/backup /path/to/backup
Chapter 10. Defining Access Control for IdM Users
10.1. Access Controls for IdM Entries
- Actor
- This is the entity who is being granted permission to do something. In LDAP access control models, this is called the bind rule because it defines who the user is and can optionally require other limits on the bind attempt, such as restricting attempts to a certain time of day or a certain machine.
- Target
- This defines the entry which the actor is allowed to perform operations on.
- Operation type
- Operation type — the last part determines what kinds of actions the user is allowed to perform. The most common operations are add, delete, write, read, and search. In Identity Management, all users are implicitly granted read and search rights to all entries in the IdM domain, with restrictions only for sensitive attributes like passwords and Kerberos keys. Anonymous users are restricted from seeing security-related configuration, like
sudorules and host-based access control.
10.1.1. Access Control Methods in Identity Management
- Self-service rules
- Self-service rules, which define what operations a user can perform on his own personal entry. The access control type only allows write permissions to attributes within the entry; it does not allow add or delete operations for the entry itself.
- Delegation rules
- Delegation rules, which allow a specific user group to perform write (edit) operations on specific attributes for users in another user group. Like self-service rules, this form of access control rule is limited to editing the values of specific attributes; it does not grant the ability to add or remove whole entries or control over unspecified attributes.
- Role-based access control
- Role-based access control, which creates special access control groups which are then granted much broader authority over all types of entities in the IdM domain. Roles can be granted edit, add, and delete rights, meaning they can be granted complete control over entire entries, not just selected attributes.Some roles are already created and available within Identity Management. Special roles can be created to manage any type of entry in specific ways, such as hosts, automount configuration, netgroups, DNS settings, and IdM configuration.
10.2. Defining Self-Service Settings
10.2.1. Creating Self-Service Rules from the Web UI
- On the IPA Server tab in the top menu, select the → subtab.
- Click Add at the top of the list of the self-service access control instructions.

Figure 10.1. Adding a Current Self-Service Rule
- Enter the name of the rule in the pop-up window. Spaces are allowed.

Figure 10.2. Form for Adding a Self-Service Rule
- Select the check boxes by the attributes which this ACI will permit users to edit.
- Click the Add button to save the new self-service ACI.
10.2.2. Creating Self-Service Rules from the Command Line
selfservice-add command. These two options are required:
--permissionsto set which permissions – such as write, add, or delete – the ACI grants--attrsto give the full list of attributes which this ACI grants permission to.
[jsmith@server ~]$ ipa selfservice-add "Users can manage their own name details" --permissions=write --attrs=givenname --attrs=displayname --attrs=title --attrs=initials
-----------------------------------------------------------
Added selfservice "Users can manage their own name details"
-----------------------------------------------------------
Self-service name: Users can manage their own name details
Permissions: write
Attributes: givenname, displayname, title, initials10.2.3. Editing Self-Service Rules

Figure 10.3. Self-Service Edit Page
ipa selfservice-mod command. The --attrs option overwrites whatever the previous list of supported attributes was, so always include the complete list of attributes along with any new attributes.
[jsmith@server ~]$ ipa selfservice-mod "Users can manage their own name details" --attrs=givenname --attrs=displayname --attrs=title --attrs=initials --attrs=surname -------------------------------------------------------------- Modified selfservice "Users can manage their own name details" -------------------------------------------------------------- Self-service name: Users can manage their own name details Permissions: write Attributes: givenname, displayname, title, initials
Important
10.3. Delegating Permissions over Users
10.3.1. Delegating Access to User Groups in the Web UI
- On the IPA Server tab in the top menu, select the → subtab.
- Click the Add link at the top of the list of the delegation access control instructions.

Figure 10.4. Adding a New Delegation
- Name the new delegation ACI.
- Set the permissions by selecting the check boxes whether users will have the right to view the given attributes (read) and add or change the given attributes (write).Some users may have a need to see information, but should not be able to edit it.
- In the User group drop-down menu, select the group who is being granted permissions to the entries of users in the user group.

Figure 10.5. Form for Adding a Delegation
- In the Member user group drop-down menu, select the group whose entries can be edited by members of the delegation group.
- In the attributes box, select the check boxes by the attributes to which the member user group is being granted permission.
- Click the Add button to save the new delegation ACI.
10.3.2. Delegating Access to User Groups in the Command Line
delegation-add command. There are three required arguments:
--group, the group who is being granted permissions to the entries of users in the user group.--membergroup, the group whose entries can be edited by members of the delegation group.--attrs, the attributes which users in the member group are allowed to view or edit.
$ ipa delegation-add "basic manager attrs" --attrs=manager --attrs=title --attrs=employeetype --attrs=employeenumber --group=engineering_managers --membergroup=engineering -------------------------------------- Added delegation "basic manager attrs" -------------------------------------- Delegation name: basic manager attrs Permissions: write Attributes: manager, title, employeetype, employeenumber Member user group: engineering User group: engineering_managers
delegation-mod command. The --attrs option overwrites whatever the previous list of supported attributes was, so always include the complete list of attributes along with any new attributes.
[jsmith@server ~]$ ipa delegation-mod "basic manager attrs" --attrs=manager --attrs=title --attrs=employeetype --attrs=employeenumber --attrs=displayname ----------------------------------------- Modified delegation "basic manager attrs" ----------------------------------------- Delegation name: basic manager attrs Permissions: write Attributes: manager, title, employeetype, employeenumber, displayname Member user group: engineering User group: engineering_managers
Important
10.4. Defining Role-Based Access Controls
- A permission defines a specific operation or set of operations (such as read, write, add, or delete) and the target entries within the IdM LDAP directory to which those operations apply. Permissions are building blocks; they can be assigned to multiple privileges as needed.With IdM permissions, you can control which users have access to which objects and even which attributes of these objects. IdM enables you to whitelist or blacklist individual attributes or change the entire visibility of a specific IdM function, such as users, groups, or sudo, to all anonymous users, all authenticated users, or just a certain group of privileged users. This flexible approach to permissions is useful in scenarios when, for example, the administrator wants to limit access of users or groups only to the specific sections these users or groups need to access and to make the other sections completely hidden to them.
- A privilege is a group of permissions that can be applied to a role. For example, a permission can be created to add, edit, and delete automount locations. Then that permission can be combined with another permission relating to managing FTP services, and they can be used to create a single privilege that relates to managing filesystems.
Note
A privilege, in the context of Red Hat Identity Management, has a very specific meaning of an atomic unit of access control on which permissions and then roles are created. Privilege escalation as a concept of regular users temporarily gaining additional privileges does not exist in Red Hat Identity Management. Privileges are assigned to users by using Role-Based Access Controls (RBAC). Users either have the role that grants access, or they do not.Apart from users, privileges are also assigned to user groups, hosts, host groups and network services. This practice permits a fine-grained control of operations by a set of users on a set of hosts via specific network services. - A role is a list of privileges which users specified for the role possess.
Table 10.1. Predefined Roles in Red Hat Identity Management
| Role | Privilege | Description |
|---|---|---|
|
Helpdesk
| Modify Users and Reset passwords, Modify Group membership | Responsible for performing simple user administration tasks |
|
IT Security Specialist
| Netgroups Administrators, HBAC Administrator, Sudo Administrator | Responsible for managing security policy such as host-based access controls, sudo rules |
|
IT Specialist
| Host Administrators, Host Group Administrators, Service Administrators, Automount Administrators | Responsible for managing hosts |
|
Security Architect
| Delegation Administrator, Replication Administrators, Write IPA Configuration, Password Policy Administrator | Responsible for managing the Identity Management environment, creating trusts, creating replication agreements |
|
User Administrator
| User Administrators, Group Administrators, Stage User Administrators | Responsible for creating users and groups |
10.4.1. Roles
10.4.1.1. Creating Roles in the Web UI
- Open the IPA Server tab in the top menu, and select the Role-Based Access Control subtab.
- Click the Add link at the top of the list of the role-based access control instructions.

Figure 10.6. Adding a New Role
- Enter the role name and a description.

Figure 10.7. Form for Adding a Role
- Click the button to save the new role and go to the configuration page.
- At the top of the Users tab, or in the Users Groups tab when adding groups, click Add.

Figure 10.8. Adding Users
- Select the users on the left and use the button to move them to the Prospective column.

Figure 10.9. Selecting Users
- At the top of the Privileges tab, click .

Figure 10.10. Adding Privileges
- Select the privileges on the left and use the button to move them to the Prospective column.

Figure 10.11. Selecting Privileges
- Click the button to save.
10.4.1.2. Creating Roles in the Command Line
- Add the new role:
[root@server ~]# kinit admin [root@server ~]# ipa role-add --desc="User Administrator" useradmin ------------------------ Added role "useradmin" ------------------------ Role name: useradmin Description: User Administrator
- Add the required privileges to the role:
[root@server ~]# ipa role-add-privilege --privileges="User Administrators" useradmin Role name: useradmin Description: User Administrator Privileges: user administrators ---------------------------- Number of privileges added 1 ----------------------------
- Add the required groups to the role. In this case, we are adding only a single group,
useradmins, which already exists.[root@server ~]# ipa role-add-member --groups=useradmins useradmin Role name: useradmin Description: User Administrator Member groups: useradmins Privileges: user administrators ------------------------- Number of members added 1 -------------------------
10.4.2. Permissions
10.4.2.1. Creating New Permissions from the Web UI
- Open the IPA Server tab in the top menu, and select the Role-Based Access Control subtab.
- Select the Permissions task link.

Figure 10.12. Permissions Task
- Click the Add button at the top of the list of the permissions.

Figure 10.13. Adding a New Permission
- Define the properties for the new permission in the form that shows up.

Figure 10.14. Form for Adding a Permission
- Click the Add button under the form to save the permission.
- Enter the name of the new permission.
- Select the appropriate Bind rule type:
- permission is the default permission type, granting access through privileges and roles
- all specifies that the permission applies to all authenticated users
- anonymous specifies that the permission applies to all users, including unauthenticated users
Note
It is not possible to add permissions with a non-default bind rule type to privileges. You also cannot set a permission that is already present in a privilege to a non-default bind rule type. - Choose the rights that the permission grants in Granted rights.
- Define the method to identify the target entries for the permission:
- Type specifies an entry type, such as user, host, or service. If you choose a value for the Type setting, a list of all possible attributes which will be accessible through this ACI for that entry type appears under Effective Attributes.Defining Type sets Subtree and Target DN to one of the predefined values.
- Subtree specifies a subtree entry; every entry beneath this subtree entry is then targeted. Provide an existing subtree entry, as Subtree does not accept wildcards or non-existent domain names (DNs). For example:
cn=automount,dc=example,dc=com
- Extra target filter uses an LDAP filter to identify which entries the permission applies to. The filter can be any valid LDAP filter, for example:
(!(objectclass=posixgroup))
IdM automatically checks the validity of the given filter. If you enter an invalid filter, IdM warns you about this after you attempt to save the permission.
- Target DN specifies the domain name (DN) and accepts wildcards. For example:
uid=*,cn=users,cn=accounts,dc=com
- Member of group sets the target filter to members of the given group.
After you fill out the filter settings and click Add, IdM validates the filter. If all the permission settings are correct, IdM will perform the search. If some of the permissions settings are incorrect, IdM will display a message informing you about which setting is set incorrectly. - If you set Type, choose the Effective attributes from the list of available ACI attributes. If you did not use Type, add the attributes manually by writing them into the Effective attributes field. Add a single attribute at a time; to add multiple attributes, click Add to add another input field.
Important
If you do not set any attributes for the permission, then all attributes are included by default.
10.4.2.2. Creating New Permissions from the Command Line
ipa permission-add command. Specify the properties of the permission by supplying the corresponding options:
- Supply the name of the permission. For example:
[root@server ~]# ipa permission-add "dns admin permission"
--bindtypespecifies the bind rule type. This options accepts theall,anonymous, andpermissionarguments. For example:--bindtype=all
If you do not use--bindtype, the type is automatically set to the defaultpermissionvalue.Note
It is not possible to add permissions with a non-default bind rule type to privileges. You also cannot set a permission that is already present in a privilege to a non-default bind rule type.--permissionslists the rights granted by the permission. You can set multiple attributes by using multiple--permissionsoptions or by listing the options in a comma-separated list inside curly braces. For example:--permissions=read --permissions=write --permissions={read,write}--attrsgives the list of attributes over which the permission is granted. You can set multiple attributes by using multiple--attrsoptions or by listing the options in a comma-separated list inside curly braces. For example:--attrs=description --attrs=automountKey --attrs={description,automountKey}The attributes provided with--attrsmust exist and be allowed attributes for the given object type, otherwise the command fails with schema syntax errors.--typedefines the entry object type, such as user, host, or service. Each type has its own set of allowed attributes. For example:[root@server ~]# ipa permission-add "manage service" --permissions=all --type=service --attrs=krbprincipalkey --attrs=krbprincipalname --attrs=managedby
--subtreegives a subtree entry; the filter then targets every entry beneath this subtree entry. Provide an existing subtree entry;--subtreedoes not accept wildcards or non-existent domain names (DNs). Include a DN within the directory.Because IdM uses a simplified, flat directory tree structure,--subtreecan be used to target some types of entries, like automount locations, which are containers or parent entries for other configuration. For example:[root@server ~]# ipa permission-add "manage automount locations" --subtree="ldap://ldap.example.com:389/cn=automount,dc=example,dc=com" --permissions=write --attrs=automountmapname --attrs=automountkey --attrs=automountInformation
The--typeand--subtreeoptions are mutually exclusive.--filteruses an LDAP filter to identify which entries the permission applies to. IdM automatically checks the validity of the given filter. The filter can be any valid LDAP filter, for example:[root@server ~]# ipa permission-add "manage Windows groups" --filter="(!(objectclass=posixgroup))" --permissions=write --attrs=description
--memberofsets the target filter to members of the given group after checking that the group exists. For example:[root@server ~]# ipa permission-add ManageHost --permissions="write" --subtree=cn=computers,cn=accounts,dc=testrelm,dc=com --attr=nshostlocation --memberof=admins
--targetgroupsets target to the specified user group after checking that the group exists.
Note
ipa permission-mod --help and ipa permission-del --help commands.
10.4.2.3. Default Managed Permissions
- You cannot modify their name, location, and target attributes.
- You cannot delete them.
- They have three sets of attributes:
- default attributes, which are managed by IdM and the user cannot modify them
- included attributes, which are additional attributes added by the user; to add an included attribute to a managed permission, specify the attribute by supplying the
--includedattrsoption with theipa permission-modcommand - excluded attributes, which are attributes removed by the user; to add an excluded attribute to a managed permission, specify the attribute by supplying the
--excludedattrsoption with theipa permission-modcommand
--attrs option when modifying a managed permission, the included and excluded attribute sets automatically adjust, so that only the attributes supplied with --attrs are enabled.
Note
permission and removing the managed permission from all privileges effectively disables it.
System:, for example System: Add Sudo rule or System: Modify Services.
- Add Automember Rebuild Membership Task
- Add Replication Agreements
- Certificate Remove Hold
- Get Certificates status from the CA
- Modify DNA Range
- Modify Replication Agreements
- Remove Replication Agreements
- Request Certificate
- Request Certificates from a different host
- Retrieve Certificates from the CA
- Revoke Certificate
- Write IPA Configuration

Figure 10.15. Disabled Attributes
System: Modify Users permission to apply to groups fails:
$ ipa permission-mod 'System: Modify Users' --type=group ipa: ERROR: invalid 'ipapermlocation': not modifiable on managed permissions
System: Modify Users permission not to apply to the GECOS attribute:
$ ipa permission-mod 'System: Modify Users' --excludedattrs=gecos ------------------------------------------ Modified permission "System: Modify Users"
10.4.2.4. Permissions in Earlier Versions of Identity Management
- The global IdM ACI granted read access to all users of the server, even anonymous ones – that is, not authenticated – users.
- Only write, add, and delete permission types were available. The read permission was available too, but it was of little practical value because all users, including unauthenticated ones, had read access by default.
- The global IdM ACI does not grant read access to unauthenticated users.
- It is now possible to, for example, add both a filter and a subtree in the same permission.
- It is possible to add search and compare rights.
Note
ipa permission-show and ipa permission-find commands recognize both the current permissions and the permissions of the previous style. While the outputs from both of these commands display permissions in the current style, the permissions themselves remain unchanged; the commands upgrade the permission entries before outputting the data only in memory, without committing the changes to LDAP.
10.4.3. Privileges
10.4.3.1. Creating New Privileges from the Web UI
- Open the IPA Server tab in the top menu, and select the Role-Based Access Control subtab.
- Select the Privileges task link.

Figure 10.16. Privileges Task
- Click the Add link at the top of the list of the privileges.

Figure 10.17. Adding a New Privilege
- Enter the name and a description of the privilege.

Figure 10.18. Form for Adding a Privilege
- Click the button to go to the privilege configuration page to add permissions.
- Select the Permissions tab.
- Click Add at the top of the list of the permissions to add permission to the privilege.

Figure 10.19. Adding Permissions
- Click the check box by the names of the permissions to add, and use the button to move the permissions to the Prospective column.

Figure 10.20. Selecting Permissions
- Click the button to save.
10.4.3.2. Creating New Privileges from the Command Line
privilege-add command, and then permissions are added to the privilege group using the privilege-add-permission command.
- Create the privilege entry.
[jsmith@server ~]$ ipa privilege-add "managing filesystems" --desc="for filesystems"
- Assign the required permissions. For example:
[jsmith@server ~]$ ipa privilege-add-permission "managing filesystems" --permissions="managing automount" --permissions="managing ftp services"
Part IV. Administration: Managing Identities
Chapter 11. Managing User Accounts
11.1. Setting up User Home Directories
/home/ directory. For example, IdM expects a user with the user_login login to have a home directory set up at /home/user_login.
Note
ipa config-mod command.
automount utility.
11.1.1. Mounting Home Directories Automatically Using the PAM Home Directory Module
Supported PAM Home Directory Modules
pam_oddjob_mkhomedirpam_mkhomedir
pam_oddjob_mkhomedir. If this module is not installed, IdM attempts to use pam_mkhomedir instead.
Configuring the PAM Home Directory Module
--mkhomedir option with the ipa-server-install or ipa-client-install utility when installing the machine.
authconfig utility. For example:
# authconfig --enablemkhomedir --update
authconfig to create home directories, see the System-Level Authentication Guide.
11.1.2. Mounting Home Directories Manually
/home/ directory that will be available to all machines in the IdM domain, and then mount the directory on an IdM machine using the automount utility.
Potential Problems When Using NFS
/home/ directory tree, or network performance issues for using remote servers for home directories.
- Use
automountto mount only the user's home directory and only when the user logs in. Do not use it to load the entire/home/tree. - Use a remote user who has limited permissions to create home directories, and mount the share on the IdM server as this user. Because the IdM server runs as an
httpdprocess, it is possible to usesudoor a similar program to grant limited access to the IdM server to create home directories on the NFS server.
Configuring Home Directories Using NFS and automount
automount:
- Create a new location for the user directory maps.
$ ipa automountlocation-add userdirs Location: userdirs
- Add a direct mapping to the new location's
auto.directfile. Theauto.directfile is theautomountmap automatically created by theipa-server-installutility. In the following example, the mount point is/share:$ ipa automountkey-add userdirs auto.direct --key=/share --info="-ro,soft, server.example.com:/home/share" Key: /share Mount information: -ro,soft, server.example.com:/home/share
automount with IdM, see Chapter 34, Using Automount.
11.2. User Life Cycle
Stageusers are not allowed to authenticate. This is an initial state. Some of the user account properties required for active users might not yet be set.Activeusers are allowed to authenticate. All required user account properties must be set in this state.Preservedusers are formeractiveusers. They are considered inactive and cannot authenticate to IdM. Preserved users retain most of the account properties they had as active users, but they are not part of any user groups.Note
The list of users in thepreservedstate can provide a history of past user accounts.
Important
admin user. If you accidentally delete all administrator accounts, the Directory Manager must create a new administrator manually in the Directory Server.
User Life Cycle Management Operations
active or stage, but not as preserved.
- stage → active
- When an account in the
stagestate is ready to be properly activated, the administrator moves it to theactivestate. - active → preserved
- After the user leaves the company, the administrator moves the account to the
preservedstate. - preserved → active
- A former user joins the company again. The administrator restores the user account by moving it from the
preservedstate back to theactivestate. - preserved → stage
- A former user is planning to join the company again. The administrator moves the account from the
preservedstate to thestagestate to prepare the account for later reactivation.
preserved state, you can only delete them permanently.

Figure 11.1. User Life Cycle Operations
11.2.1. Adding Stage or Active Users
Adding Users in the Web UI
- Select the → tab.
- Select the Active users or Stage users category, depending on whether you want to add a user in the
activeorstagestate.
Figure 11.2. Selecting User Category
For more information about theactiveorstageuser life cycle states, see Section 11.2, “User Life Cycle”. - Click Add at the top of the users list.

Figure 11.3. Adding a User
- Fill in the Add User form.Note that if you do not set a user login manually, IdM generates the login automatically based on the specified first name and last name.
- Click .Alternatively, click to start adding another user or to start editing the new user entry. For information on editing user entries, see Section 11.3, “Editing Users”.
Adding Users from the Command Line
active state, use the ipa user-add command. To add a new user in the stage state, use the ipa stageuser-add command.
Note
active or stage user life cycle states, see Section 11.2, “User Life Cycle”.
ipa user-add and ipa stageuser-add prompt you for the minimum required user attributes and use default values for the other attributes. Alternatively, you can add options specifying various attributes directly to the commands.
$ ipa user-add First name: first_name Last name: last_name User login [default_login]: custom_login
ipa user-add and ipa stageuser-add enables you to define custom values for many of the user attributes. This means that you can specify more information than in the interactive session. For example, to add a stage user:
$ ipa stageuser-add stage_user_login --first=first_name --last=last_name --email=email_address
ipa user-add and ipa stageuser-add, run the commands with the --help option added.
11.2.1.1. User Name Requirements
[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?Note
user and User.
ipa config-mod --maxusername command. For example, to increase the maximum user name length to 64 characters:
$ ipa config-mod --maxusername=64 Maximum username length: 64 ...
11.2.1.2. Defining a Custom UID or GID Number
11.2.2. Listing Users and Searching for Users
Listing Users in the Web UI
- Select the → tab.
- Select the Active users, Stage users, or Preserved users category.

Figure 11.4. Listing Users
Displaying Information About a User in the Web UI

Figure 11.5. Displaying User Information
Listing Users from the Command Line
ipa user-find command. To list all stage users, use the ipa stageuser-find command. To list preserved users, run the ipa user-find --preserved=true command.
$ ipa user-find --------------- 23 users matched --------------- User login: admin Last name: Administrator Home directory: /home/admin Login shell: /bin/bash UID: 1453200000 GID: 1453200000 Account disabled: False Password: True Kerberos keys available: True User login: user ...
ipa user-find and ipa stageuser-find, you can define the search criteria and filter the search results. For example, to display all active users with a specific title defined:
$ ipa user-find --title=user_title --------------- 2 users matched --------------- User login: user ... Job Title: Title ... User login: user2 ... Job Title: Title ...
user:
$ ipa user-find user --------------- 3 users matched --------------- User login: user ... User login: user2 ... User login: user3 ...
ipa user-find and ipa stageuser-find, run the commands with the --help option added.
Displaying Information about a User from the Command Line
ipa user-show command:
$ ipa user-show user_login User login: user_login First name: first_name Last name: last_name ...
ipa stageuser-show command:
11.2.3. Activating, Preserving, Deleting, and Restoring Users
Managing User Life Cycle in the Web UI
- In the Stage users list, select the user to activate, and click .

Figure 11.6. Activating a User
- In the Active users or Stage users lists, select the user. Click .

Figure 11.7. Deleting a User
- If you selected an active user, select delete or preserve. If you selected a stage user, you can only delete the user. The default UI option is delete.For example, to preserve an active user:

Figure 11.8. Selecting the Delete Mode in the Web UI
To confirm, click the button.
- In the Preserved users list, select the user to restore, and click .

Figure 11.9. Restoring a User
Note
preserved state to the stage state.
Managing User Life Cycle from the Command Line
stage to active, use the ipa stageuser-activate command.
$ ipa stageuser-activate user_login ------------------------- Stage user user_login activated ------------------------- ...
ipa user-del or ipa stageuser-del commands.
- To remove an active user permanently from the IdM database, run
ipa user-delwithout any options.$ ipa user-del user_login -------------------- Deleted user "user3" --------------------
- To preserve an active user account, run
ipa user-delwith the--preserveoption.$ ipa user-del --preserve user_login -------------------- Deleted user "user_login" --------------------
- To remove a stage user permanently from the IdM database, run
ipa stageuser-del.$ ipa stageuser-del user_login -------------------------- Deleted stage user "user_login" --------------------------
Note
--continue option to force the command to continue regardless of errors. A summary of the successful and failed operations is printed to the stdout standard output stream when the command completes.
$ ipa user-del --continue user1 user2 user3
--continue is not used, the command proceeds with deleting users until it encounters an error, after which it stops and exits.
preserved to active, use the ipa user-undel command.
$ ipa user-undel user_login ------------------------------ Undeleted user account "user_login" ------------------------------
preserved to stage, use the ipa user-stage command.
$ ipa user-stage user_login ------------------------------ Staged user account "user_login" ------------------------------
Note
--help option added.
11.3. Editing Users
Editing Users in the Web UI
- Select the → tab.
- Search the Active users, Stage users, or Preserved users category to find the user to edit.
- Click the name of the user to edit.

Figure 11.10. Selecting a User to Edit
- Edit the user attribute fields as required.
- Click at the top of the page.

Figure 11.11. Save Modified User Attributes
Editing Users from the Command Line
active or preserved states, use the ipa user-mod command. To modify a user in the stage state, use the ipa stageuser-mod command.
ipa user-mod and ipa stageuser-mod commands accept the following options:
- the user login, which identifies the user account to be modified
- options specifying the new attribute values
ipa user-mod and ipa stageuser-mod. To display the list of options, run the commands with the --help option added.
ipa user-mod or ipa stageuser-mod overwrites the current attribute value. For example, the following changes a user's title or adds a new title if the user did not yet have a title specified:
$ ipa user-mod user_login --title=new_title
--addattr option together with the option to specify the new attribute value. For example, to add a new email address to a user account that already has an email address specified:
$ ipa user-mod user --addattr=mobile=new_mobile_number
--------------------
Modified user "user"
--------------------
User login: user
...
Mobile Telephone Number: mobile_number, new_mobile_number
...
--addattr option twice:
$ ipa user-mod user --addattr=mobile=mobile_number_1 --addattr=mobile=mobile_number_2
ipa user-mod command also accepts the --setattr option for setting attribute values and the --delattr option for deleting attribute values. These options are used in a way similar to using --addattr. For details, see the output of the ipa user-mod --help command.
Note
--email option. However, to add an additional email address, use the mail option with the --addattr option:
$ ipa user-mod user --email=email@example.com $ ipa user-mod user --addattr=mail=another_email@example.com
11.4. Enabling and Disabling User Accounts
active state. Therefore, they are displayed in the output of the ipa user-find command. For example:
$ ipa user-find
...
User login: user
First name: User
Last name: User
Home directory: /home/user
Login shell: /bin/sh
UID: 1453200009
GID: 1453200009
Account disabled: True
Password: False
Kerberos keys available: False
...
Note
Enabling and Disabling User Accounts in the Web UI
- Select the → tab.
- From the Active users list, select the required user or users, and then click or .

Figure 11.12. Disabling or Enabling a User Account
Disabling and Enabling User Accounts from the Command Line
ipa user-disable command.
$ ipa user-disable user_login ---------------------------- Disabled user account "user_login" ----------------------------
ipa user-enable command.
$ ipa user-enable user_login ---------------------------- Enabled user account "user_login" ----------------------------
11.5. Allowing Non-admin Users to Manage User Entries
admin user is allowed to manage user life cycle and disable or enable user accounts. To allow another, non-admin user to do this, create a new role, add the relevant permissions to this role, and assign the non-admin user to the role.
- Modify Users and Reset passwords
- This privilege includes permissions to modify various user attributes.
- User Administrators
- This privilege includes permissions to add active users, activate non-active users, remove users, modify user attributes, and other permissions.
- Stage User Provisioning
- This privilege includes a permission to add stage users.
- Stage User Administrator
- This privilege includes permissions to perform a number of life cycle operations, such as adding stage users or moving users between life cycle states. However, it does not include permissions to move users to the active state.
Allowing Different Users to Perform Different User Management Operations
- Configuring one user as a stage user administrator, who is allowed to add future employees to IdM as stage users, but not to activate them.
- Configuring another user as a security administrator, who is allowed to activate the stage users after their employee credentials are verified on the first day of employment.
Example 11.1. Allowing a Non-admin User to Add Stage Users
- Log in as the
adminuser or another user allowed to manage role-based access control.$ kinit admin
- Create a new custom role to manage adding stage users.
- Create the
System Provisioningrole.$ ipa role-add --desc "Responsible for provisioning stage users" "System Provisioning" -------------------------------- Added role "System Provisioning" -------------------------------- Role name: System Provisioning Description: Responsible for provisioning stage users
- Add the
Stage User Provisioningprivilege to the role. This privilege provides the ability to add stage users.$ ipa role-add-privilege "System Provisioning" --privileges="Stage User Provisioning" Role name: System Provisioning Description: Responsible for provisioning stage users Privileges: Stage User Provisioning ---------------------------- Number of privileges added 1 ----------------------------
- Grant a non-admin user the rights to add stage users.
- If the non-admin user does not yet exist, create a new user. In this example, the user is named
stage_user_admin.$ ipa user-add stage_user_admin --password First name: first_name Last name: last_name Password: Enter password again to verify: ...
- Assign the
stage_user_adminuser to theSystem Provisioningrole.$ ipa role-add-member "System Provisioning" --users=stage_user_admin Role name: System Provisioning Description: Responsible for provisioning stage users Member users: stage_user_admin Privileges: Stage User Provisioning ------------------------- Number of members added 1 -------------------------
- To make sure the
System Provisioningrole is configured correctly, you can use theipa role-showcommand to display the role settings.$ ipa role-show "System Provisioning" -------------- 1 role matched -------------- Role name: System provisioning Description: Responsible for provisioning stage users Member users: stage_user_admin Privileges: Stage User Provisioning ---------------------------- Number of entries returned 1 ----------------------------
- Test adding a new stage user as the
stage_user_adminuser.- Log in as
stage_user_admin. Note that if you createdstage_user_adminas a new user in one of the previous steps, IdM will ask you to change the initial password set byadmin.$ kinit stage_user_admin Password for stage_user_admin@EXAMPLE.COM: Password expired. You must change it now. Enter new password: Enter it again:
- To make sure your Kerberos ticket for
adminhas been replaced with a Kerberos ticket forstage_user_admin, you can use theklistutility.$ klist Ticket cache: KEYRING:persistent:0:krb_ccache_xIlCQDW Default principal: stage_user_admin@EXAMPLE.COM Valid starting Expires Service principal 02/25/2016 11:42:20 02/26/2016 11:42:20 krbtgt/EXAMPLE.COM - Add a new stage user.
$ ipa stageuser-add stage_user First name: first_name Last name: last_name ipa: ERROR: stage_user: stage user not found
Note
The error that IdM reports after adding a stage user is expected. Thestage_user_adminis only allowed to add stage users, not to display information about them. Therefore, instead of displaying a summary of the newly addedstage_usersettings, IdM displays the error.
stage_user_admin user is not allowed to display information about stage users. Therefore, an attempt to display information about the new stage_user user while logged in as stage_user_admin fails:
$ ipa stageuser-show stage_user ipa: ERROR: stage_user: stage user not found
stage_user, you can log in as admin:
$ kinit admin Password for admin@EXAMPLE.COM: $ ipa stageuser-show stage_user User login: stage_user First name: Stage Last name: User ...
11.6. Using an External Provisioning System for Users and Groups
11.6.1. Configuring User Accounts to Be Used by the External Provisioning System
- Create a user,
provisionator, with the privileges to add stage users. The user account will be used by the external provisioning system to add new stage users.- Add the
provisionatoruser account:$ ipa user-add provisionator --first=provisioning --last=account --password
- Grant the
provisionatoruser the required privileges.Create a custom role,System Provisioning, to manage adding stage users:$ ipa role-add --desc "Responsible for provisioning stage users" "System Provisioning"
Add theStage User Provisioningprivilege to the role. This privilege provides the ability to add stage users:$ ipa role-add-privilege "System Provisioning" --privileges="Stage User Provisioning"
Add theprovisionatoruser to the role:$ ipa role-add-member --users=provisionator "System Provisioning"
- Create a user,
activator, with the privileges to manage user accounts. The user account will be used to automatically activate stage users added by the external provisioning system.- Add the
activatoruser account:$ ipa user-add activator --first=activation --last=account --password
- Grant the
activatoruser the required privileges.Add the user to the defaultUser Administratorrole:$ ipa role-add-member --users=activator "User Administrator"
- Create a user group for service and application accounts:
$ ipa group-add service-accounts
- Update the password policy for the group. The following policy prevents password expiration and lockout for the account but compensates the potential risks by requiring complex passwords:
$ ipa pwpolicy-add service-accounts --maxlife=10000 --minlife=0 --history=0 --minclasses=4 --minlength=20 --priority=1 --maxfail=0 --failinterval=1 --lockouttime=0
- Add the provisioning and activation accounts to the group for service and application accounts:
$ ipa group-add-member service-accounts --users={provisionator,activator} - Change the passwords for the user accounts:
$ kpasswd provisionator $ kpasswd activator
Changing the passwords is necessary because passwords of new IdM users expire immediately.
- For details on adding new users, see Section 11.2.1, “Adding Stage or Active Users”.
- For details on granting users the privileges required to manage other user accounts, see Section 11.5, “Allowing Non-admin Users to Manage User Entries”.
- For details on managing IdM password policies, see Chapter 28, Defining Password Policies.
11.6.2. Configuring IdM to Automatically Activate Stage User Accounts
Important
- Generate a keytab file for the activation account:
# ipa-getkeytab -s example.com -p "activator" -k /etc/krb5.ipa-activation.keytab
If you want to enable the activation process on more than one IdM server, generate the keytab file on one server only. Then copy the keytab file to the other servers. - Create a script,
/usr/local/sbin/ipa-activate-all, with the following contents to activate all users:#!/bin/bash kinit -k -i activator ipa stageuser-find --all --raw | grep " uid:" | cut -d ":" -f 2 | while read uid; do ipa stageuser-activate ${uid}; done - Edit the permissions and ownership for the
ipa-activate-allscript to make it executable:# chmod 755 /usr/local/sbin/ipa-activate-all # chown root:root /usr/local/sbin/ipa-activate-all
- Create a
systemdunit file,/etc/systemd/system/ipa-activate-all.service, with the following contents:[Unit] Description=Scan IdM every minute for any stage users that must be activated [Service] Environment=KRB5_CLIENT_KTNAME=/etc/krb5.ipa-activation.keytab Environment=KRB5CCNAME=FILE:/tmp/krb5cc_ipa-activate-all ExecStart=/usr/local/sbin/ipa-activate-all
- Create a
systemdtimer,/etc/systemd/system/ipa-activate-all.timer, with the following contents:[Unit] Description=Scan IdM every minute for any stage users that must be activated [Timer] OnBootSec=15min OnUnitActiveSec=1min [Install] WantedBy=multi-user.target
- Enable
ipa-activate-all.timer:# systemctl enable ipa-activate-all.timer
- For more information on
systemdunit files, see the Managing Services with systemd Unit Files chapter of the System Administrator's Guide.
11.6.3. Configuring the LDAP Provider of the External Provisioning System to Manage the IdM Identities
Managing User Accounts Using LDAP
ldapmodify utility.
ldapmodify. For detailed example procedures, see Example 11.2, “Adding a Stage User with ldapmodify” and Example 11.3, “Preserving a User with ldapmodify”.
- Adding a new stage user
- Adding a user with UID and GID automatically assigned:
dn: uid=user_login,cn=staged users,cn=accounts,cn=provisioning,dc=example,dc=com changetype: add objectClass: top objectClass: inetorgperson uid: user_login sn: surname givenName: first_name cn: full_name
Adding a user with UID and GID statically assigned:dn: uid=user_login,cn=staged users,cn=accounts,cn=provisioning,dc=example,dc=com changetype: add objectClass: top objectClass: person objectClass: inetorgperson objectClass: organizationalperson objectClass: posixaccount uid: user_login uidNumber: UID_number gidNumber: GID_number sn: surname givenName: first_name cn: full_name homeDirectory: /home/user_login
You are not required to specify any IdM object classes when adding stage users. IdM adds these classes automatically after the users are activated.Note that the distinguished name (DN) of the created entry must start withuid=user_login. - Modifying existing users
- Before modifying a user, obtain the user's distinguished name (DN) by searching by the user's login. In the following example, the user_allowed_to_read user in the following example is a user allowed to read user and group information, and password is this user's password:
# ldapsearch -LLL -x -D "uid=user_allowed_to_read,cn=users,cn=accounts,dc=example, dc=com" -w "password" -H ldap://server.example.com -b "cn=users, cn=accounts, dc=example, dc=com" uid=user_login
To modify a user's attribute:dn: distinguished_name changetype: modify replace: attribute_to_modify attribute_to_modify: new_value
To disable a user:dn: distinguished_name changetype: modify replace: nsAccountLock nsAccountLock: TRUE
To enable a user:dn: distinguished_name changetype: modify replace: nsAccountLock nsAccountLock: FALSE
To preserve a user:dn: distinguished_name changetype: modrdn newrdn: uid=user_login deleteoldrdn: 0 newsuperior: cn=deleted users,cn=accounts,cn=provisioning,dc=example
Updating thenssAccountLockattribute has no effect on stage and preserved users. Even though the update operation completes successfully, the attribute value remainsnssAccountLock: TRUE. - Creating a new group
- To create a new group:
dn: cn=group_distinguished_name,cn=groups,cn=accounts,dc=example,dc=com changetype: add objectClass: top objectClass: ipaobject objectClass: ipausergroup objectClass: groupofnames objectClass: nestedgroup objectClass: posixgroup cn: group_name gidNumber: GID_number
- Modifying groups
- Before modifying a group, obtain the group's distinguished name (DN) by searching by the group's name.
# ldapsearch -YGSSAPI -H ldap://server.example.com -b "cn=groups,cn=accounts,dc=example,dc=com" "cn=group_name"
To delete an existing group:dn: group_distinguished_name changetype: delete
To add a member to a group:dn: group_distinguished_name changetype: modify add: member member: uid=user_login,cn=users,cn=accounts,dc=example,dc=com
To remove a member from a group:dn: distinguished_name changetype: modify delete: member member: uid=user_login,cn=users,cn=accounts,dc=example,dc=com
Do not add stage or preserved users to groups. Even though the update operation completes successfully, the users will not be updated as members of the group. Only active users can belong to groups.
Example 11.2. Adding a Stage User with ldapmodify
stageuser user using the standard interorgperson object class:
- Use
ldapmodifyto add the user.# ldapmodify -Y GSSAPI SASL/GSSAPI authentication started SASL username: admin@EXAMPLE SASL SSF: 56 SASL data security layer installed. dn: uid=stageuser,cn=staged users,cn=accounts,cn=provisioning,dc=example changetype: add objectClass: top objectClass: inetorgperson cn: Stage sn: User adding new entry "uid=stageuser,cn=staged users,cn=accounts,cn=provisioning,dc=example"
- Consider validating the contents of the stage entry to make sure your provisioning system added all required POSIX attributes and the stage entry is ready to be activated. To display the new stage user's LDAP attributes using the
ipa stageuser-show --all --rawcommand. Note that the user is explicitly disabled by thensaccountlockattribute:$ ipa stageuser-show stageuser --all --raw dn: uid=stageuser,cn=staged users,cn=accounts,cn=provisioning,dc=example uid: stageuser sn: User cn: Stage has_password: FALSE has_keytab: FALSE nsaccountlock: TRUE objectClass: top objectClass: inetorgperson objectClass: organizationalPerson objectClass: person
Example 11.3. Preserving a User with ldapmodify
user by using the LDAP modrdn operation:
- Use the
ldapmodifyutility to modify the user entry.$ ldapmodify -Y GSSAPI SASL/GSSAPI authentication started SASL username: admin@EXAMPLE SASL SSF: 56 SASL data security layer installed. dn: uid=user1,cn=users,cn=accounts,dc=example changetype: modrdn newrdn: uid=user1 deleteoldrdn: 0 newsuperior: cn=deleted users,cn=accounts,cn=provisioning,dc=example modifying rdn of entry "uid=user1,cn=users,cn=accounts,dc=example"
- Optionally, verify the user has been preserved by listing all preserved users.
$ ipa user-find --preserved=true --------------- 1 user matched --------------- User login: user1 First name: first_name Last name: last_name ... ---------------------------- Number of entries returned 1 ----------------------------
Chapter 12. Managing Hosts
- DNS entries and settings
- Machine authentication
- Host name changes (which affect domain services)
12.1. About Hosts, Services, and Machine Identity and Authentication
- Service entries associated with the host
- The host and service principal
- Access control rules
- Machine information, such as its physical location and operating system
- DNS
- Kerberos
- Certificate management
- Joining the DNS domain (machine enrollment)
- Managing DNS entries and zones
- Managing machine authentication
- SSH keys. The SSH public key for the host is created and uploaded to the host entry. From there, the System Security Services Daemon (SSSD) uses IdM as an identity provider and can work in conjunction with OpenSSH and other services to reference the public keys located centrally in Identity Management. This is described in Section 12.5, “Managing Public SSH Keys for Hosts”.
- Key tables (or keytabs, a symmetric key resembling to some extent a user password) and machine certificates. Kerberos tickets are generated as part of the Kerberos services and policies defined by the server. Initially granting a Kerberos ticket, renewing the Kerberos credentials, and even destroying the Kerberos session are all handled by the IdM services. Managing Kerberos is covered in Chapter 29, Managing the Kerberos Domain.
- Machine certificates. In this case, the machine uses an SSL certificate that is issued by the IdM server's certificate authority and then stored in IdM's Directory Server. The certificate is then sent to the machine to present when it authenticates to the server. On the client, certificates are managed by a service called certmonger.
12.2. About Host Entry Configuration Properties
Table 12.1. Host Configuration Properties
| UI Field | Command-Line Option | Description |
|---|---|---|
| Description | --desc=description | A description of the host. |
| Locality | --locality=locality | The geographic location of the host. |
| Location | --location=location | The physical location of the host, such as its data center rack. |
| Platform | --platform=string | The host hardware or architecture. |
| Operating system | --os=string | The operating system and version for the host. |
| MAC address | --macaddress=address | The MAC address for the host. This is a multi-valued attribute. The MAC address is used by the NIS plug-in to create a NIS ethers map for the host. |
| SSH public keys | --sshpubkey=string | The full SSH public key for the host. This is a multi-valued attribute, so multiple keys can be set. |
| Principal name (not editable) | --principalname=principal | The Kerberos principal name for the host. This defaults to the host name during the client installation, unless a different principal is explicitly set in the -p. This can be changed using the command-line tools, but cannot be changed in the UI. |
| Set One-Time Password | --password=string | Sets a password for the host which can be used in bulk enrollment. |
| - | --random | Generates a random password to be used in bulk enrollment. |
| - | --certificate=string | A certificate blob for the host. |
| - | --updatedns | This sets whether the host can dynamically update its DNS entries if its IP address changes. |
12.3. Adding Host Entries
12.3.1. Adding Host Entries from the Web UI
- Open the Identity tab, and select the Hosts subtab.
- Click at the top of the hosts list.

Figure 12.1. Adding Host Entries
- Fill in the machine name and select the domain from the configured zones in the drop-down list. If the host has already been assigned a static IP address, then include that with the host entry so that the DNS entry is fully created.Optionally, to add an extra value to the host for some use cases, use the Class field. Semantics placed on this attribute are for local interpretation.

Figure 12.2. Add Host Wizard
DNS zones can be created in IdM, which is described in Section 33.4.1, “Adding and Removing Master DNS Zones”. If the IdM server does not manage the DNS server, the zone can be entered manually in the menu area, like a regular text field.Note
Select the Force check box if you want to skip checking whether the host is resolvable via DNS. - Click the Add and Edit button to go directly to the expanded entry page and fill in more attribute information. Information about the host hardware and physical location can be included with the host entry.

Figure 12.3. Expanded Entry Page
12.3.2. Adding Host Entries from the Command Line
host-add command. This commands adds the host entry to the IdM Directory Server. The full list of options with host-add are listed in the ipa host manpage. At its most basic, an add operation only requires the client host name to add the client to the Kerberos realm and to create an entry in the IdM LDAP server:
$ ipa host-add client1.example.com
--ip-address and --force options.
Example 12.1. Creating Host Entries with Static IP Addresses
$ ipa host-add --force --ip-address=192.168.166.31 client1.example.com
--force. This essentially creates a placeholder entry in the IdM DNS service. When the DNS service dynamically updates its records, the host's current IP address is detected and its DNS record is updated.
Example 12.2. Creating Host Entries with DHCP
$ ipa host-add --force client1.example.com
host-del command. If the IdM domain uses DNS, then the --updatedns option also removes the associated records of any kind for the host from the DNS.
$ ipa host-del --updatedns client1.example.com
12.4. Disabling and Re-enabling Host Entries
12.4.1. Disabling Host Entries
host-disable command.
[jsmith@ipaserver ~]$ kinit admin [jsmith@ipaserver ~]$ ipa host-disable server.example.com
Important
12.4.2. Re-enabling Hosts
ipa-getkeytab command. The -s option sets which IdM server to request the keytab, -p gives the principal name, and -k gives the file to which to save the keytab.
[jsmith@ipaserver ~]$ ipa-getkeytab -s ipaserver.example.com -p host/server.example.com -k /etc/krb5.keytab -D fqdn=server.example.com,cn=computers,cn=accounts,dc=example,dc=com -w password
ipa-getkeytab command is run on an active IdM client or server, then it can be run without any LDAP credentials (-D and -w). The IdM user uses Kerberos credentials to authenticate to the domain. To run the command directly on the disabled host, then supply LDAP credentials to authenticate to the IdM server. The credentials should correspond to the host or service which is being re-enabled.
12.5. Managing Public SSH Keys for Hosts
known_hosts file. Any time that the remote machine attempts to access the target machine again, the target machine simply checks its known_hosts file and then grants access automatically to approved hosts.
- The
known_hostsfile stores host entries in a triplet of the host IP address, host name, and key. This file can rapidly become out of date if the IP address changes (which is common in virtual environments and data centers) or if the key is updated. - SSH keys have to be distributed manually and separately to all machines in an environment.
- Administrators have to approve host keys to add them to the configuration, but it is difficult to verify either the host or key issuer properly, which can create security problems.
12.5.1. About the SSH Key Format
~/.ssh/known_hosts, a key entry is identified by the host name and IP address of the server, its type, then lastly the key itself. For example:
host.example.com,1.2.3.4 ssh-rsa AAA...ZZZ==
"ssh-rsa ABCD1234...== ipaclient.example.com"
~/.ssh/known_hosts file needs to be reordered to match the format of a user key, type key== comment:
ssh-rsa AAA...ZZZ== host.example.com,1.2.3.4
12.5.2. About ipa-client-install and OpenSSH
ipa-client-install script, by default, configures an OpenSSH server and client on the IdM client machine. It also configures SSSD to perform host and user key caching. Essentially, simply configuring the client does all of the configuration necessary for the host to use SSSD, OpenSSH, and Identity Management for key caching and retrieval.
ssh service is first started.
Note
ipa-client-install, the client is created with two SSH keys, RSA and DSS.
--ssh-trust-dns, which can be run with ipa-client-install and automatically configures OpenSSH to trust the IdM DNS records, where the key fingerprints are stored.
--no-sshd option. This prevents the install script from configuring the OpenSSH server.
--no-dns-sshfp, prevents the host from creating DNS SSHFP records with its own DNS entries. This can be used with or without the --no-sshd option.
12.5.3. Uploading Host SSH Keys Through the Web UI
- The key for a host can probably be retrieved from a
~/.ssh/known_hosts. For example:server.example.com,1.2.3.4 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApvjBvSFSkTU0WQW4eOweeo0DZZ08F9Ud21xlLy6FOhzwpXFGIyxvXZ52+siHBHbbqGL5+14N7UvElruyslIHx9LYUR/pPKSMXCGyboLy5aTNl5OQ5EHwrhVnFDIKXkvp45945R7SKYCUtRumm0Iw6wq0XD4o+ILeVbV3wmcB1bXs36ZvC/M6riefn9PcJmh6vNCvIsbMY6S+FhkWUTTiOXJjUDYRLlwM273FfWhzHK+SSQXeBp/zIn1gFvJhSZMRi9HZpDoqxLbBB9QIdIw6U4MIjNmKsSI/ASpkFm2GuQ7ZK9KuMItY2AoCuIRmRAdF8iYNHBTXNfFurGogXwRDjQ==
If necessary, generate a host key. When using the OpenSSH tools, make sure to use a blank passphrase and to save the key to a different location than the user's~/.ssh/directory, so it will not overwrite any existing keys.[jsmith@server ~]$ ssh-keygen -t rsa -C "server.example.com,1.2.3.4" Generating public/private rsa key pair. Enter file in which to save the key (/home/jsmith/.ssh/id_rsa): /home/jsmith/.ssh/host_keys Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/jsmith/.ssh/host_keys. Your public key has been saved in /home/jsmith/.ssh/host_keys.pub. The key fingerprint is: SHA256:GAUIDVVEgly7rs1lTWP6oguHz8BKvyZkpqCqVSsmi7c server.example.com The key's randomart image is: +--[ RSA 2048]----+ | .. | | .+| | o .* | | o . .. *| | S + . o+| | E . .. .| | . = . o | | o . ..o| | .....| +-----------------+
- Copy the public key from the key file. The full key entry has the form host name,IP type key==. Only the key== is required, but the entire entry can be stored. To use all elements in the entry, rearrange the entry so it has the order type key== [host name,IP]
[jsmith@server ~]$ cat /home/jsmith/.ssh/host_keys.pub ssh-rsa AAAAB3NzaC1yc2E...tJG1PK2Mq++wQ== server.example.com,1.2.3.4
- Open the Identity tab, and select the Hosts subtab.
- Click the name of the host to edit.

Figure 12.4. List of Hosts
- In the Host Settings area of the Settings tab, click Add next to SSH public keys.

Figure 12.5. Adding an SSH Key
- Paste in the public key for the host, and click .

Figure 12.6. Setting an SSH Key
The SSH public keys area now shows the new key. Clicking Show/Set key opens the submitted key. - To upload multiple keys, click the Add link below the list of public keys, and upload the other keys.
- When all the keys have been submitted, click Save at the top of the host's page to save the changes.
12.5.4. Adding Host Keys from the Command Line
host-add or by modifying the entry later.
Note
ipa-client-install command, unless the SSH service is explicitly disabled in the installation script.
- Run the
host-modcommand with the--sshpubkeyoption to upload the base64-encoded public key to the host entry.Adding a host key also changes the DNS SSHFP entry for the host, so also use the--updatednsoption to update the host's DNS entry.For example:[jsmith@server ~]$ ipa host-mod --sshpubkey="ssh-rsa RjlzYQo==" --updatedns host1.example.com
A real key also usually ends with an equal sign (=) but is longer.To upload more than one key, enter multiple--sshpubkeycommand-line parameters:--sshpubkey="RjlzYQo==" --sshpubkey="ZEt0TAo=="
Note
A host can have multiple public keys. - After uploading the host keys, configure SSSD to use Identity Management as one of its identity domains and set up OpenSSH to use the SSSD tooling for managing host keys. This is covered in the "Configuring Services: OpenSSH and Cached Keys" in the System-Level Authentication Guide.
12.5.5. Removing Host Keys
- Open the Identity tab, and select the Hosts subtab.
- Click the name of the host to edit.

Figure 12.7. List of Hosts
- In the SSH public keys area, click Delete by the fingerprint of the key to remove it.

Figure 12.8. Public Key Deletion
- Click Save at the top of the host's page to save the changes.
ipa host-mod with the --sshpubkey= set to a blank value; this removes all public keys for the host. Also, use the --updatedns option to update the host's DNS entry. For example:
[jsmith@server ~]$ kinit admin [jsmith@server ~]$ ipa host-mod --sshpubkey= --updatedns host1.example.com
12.6. Setting ethers Information for a Host
ethers table which can be used to manage DHCP configuration files for systems based on their platform, operating system, DNS domain, and MAC address — all information stored in host entries in IdM.
ethers entry in the directory, in the ou=ethers subtree.
cn=server,ou=ethers,dc=example,dc=com
ethers service which can be managed by the NIS compatibility plug-in in IdM.
ethers entries:
- Add the MAC address attribute to a host entry. For example:
[jsmith@server ~]$ kinit admin [jsmith@server ~]$ ipa host-mod --macaddress=12:34:56:78:9A:BC server.example.com
- Open the
nsswitch.conffile. - Add a line for the
ethersservice, and set it to use LDAP for its lookup.ethers: ldap
- Check that the
ethersinformation is available for the client.[root@server ~]# getent ethers server.example.com
Chapter 13. Managing User and Host Groups
13.1. How User and Host Groups Work in IdM
13.1.1. What User and Host Groups Are
13.1.2. Supported Group Members
- IdM users
- other IdM user groups
- external users, which are users that exist outside IdM
- IdM servers and clients
- other IdM host groups
13.1.3. Direct and Indirect Group Members
- User 1 and User 2 are direct members of group A.
- User 3, User 4, and User 5 are indirect members of group A.

Figure 13.1. Direct and Indirect Group Membership
Example 13.1. Viewing Direct and Indirect Group Members
- Create two groups:
group_Aandgroup_B. See Section 13.2, “Adding and Removing User or Host Groups”. - Add:
- one user as a member of
group_A - another user as a member of
group_B group_Bas a member ofgroup_A
- In the web UI: Select → . From the individual group types which are listed in a side bar on the left, select , and click the name of
group_A. Switch between Direct Membership and Indirect Membership. - From the command line: Use the
ipa group-showcommand:$ ipa group-show group_A ... Member users: user_1 Member groups: group_B Indirect Member users: user_2
13.1.4. User Group Types in IdM
- POSIX groups (the default)
- POSIX groups support POSIX attributes for their members. Note that groups that interact with Active Directory cannot use POSIX attributes.
- Non-POSIX groups
- All group members of this type of group must belong to the IdM domain.
- External groups
- External groups allow adding group members that exist in an identity store outside of the IdM domain. The external store can be a local system, an Active Directory domain, or a directory service.
Example 13.2. Searching for Different Types of User Groups
- Run the
ipa group-findcommand to display all user groups. - Run the
ipa group-find --posixcommand to display all POSIX groups. - Run the
ipa group-find --nonposixcommand to display all non-POSIX groups. - Run the
ipa group-find --externalcommand to display all external groups.
13.1.5. User and Host Groups Created by Default
Table 13.1. User and Host Groups Created by Default
| Group Name | User or Host | Default Group Members |
|---|---|---|
ipausers | User group | All IdM users |
admins | User group | Users with administrative privileges, initially the default admin user |
editors | User group | Users allowed to edit other IdM users in the web UI, without all the rights of an administrative user |
trust admins | User group | Users with privileges to manage Active Directory trusts |
ipaservers | Host group | All IdM server hosts |
admins group grants the user administrative privileges.
Warning
ipaservers host group. All hosts in ipaservers have the ability to promote themselves to an IdM server.
- The user private group has the same name as the user for which it was created.
- The user is the only member of the user private group.
- GID of the private groups matches the UID of the user.
Example 13.3. Viewing User Private Groups
ipa group-find --private command to display all user private groups:
$ ipa group-find --private ---------------- 2 groups matched ---------------- Group name: user1 Description: User private group for user1 GID: 830400006 Group name: user2 Description: User private group for user2 GID: 830400004 ---------------------------- Number of entries returned 2 ----------------------------
13.2. Adding and Removing User or Host Groups
- The web UI (see the section called “Web UI: Adding a User or Host Group”)
- The command line (see the section called “Command Line: Adding a User or Host Group”)
- The web UI (see the section called “Web UI: Removing a User or Host Group”)
- The command line (see the section called “Command Line: Removing a User or Host Group”)
Web UI: Adding a User or Host Group
- Click → , and select or in the left sidebar.
- Click to start adding the group.
- Fill out the information about the group.For details on user group types, see Section 13.1.4, “User Group Types in IdM”.
- Click to confirm.
Command Line: Adding a User or Host Group
- Log in as the administrator:
$ kinit admin
- To add a user group, use the
ipa group-addcommand. To add a host group, use theipa hostgroup-addcommand.$ ipa group-add group_name ----------------------- Added group "group_name" ------------------------
ipa group-add adds a POSIX user group. To specify a different group type, add options to ipa group-add:
--nonposixto create a non-POSIX group--externalto create an external group
Web UI: Removing a User or Host Group
- Click → and select or in the left sidebar.
- Select the group to remove, and click .
Command Line: Removing a User or Host Group
- Log in as the administrator:
$ kinit admin
- To delete a user group, use the
ipa group-del group_namecommand. To delete a host group, use theipa hostgroup-del group_namecommand.$ ipa group-del group_name -------------------------- Deleted group "group_name" --------------------------
13.3. Adding and Removing User or Host Group Members
- The IdM web UI (see the section called “Web UI: Adding a Member to a User or Host Group”)
- The command line (see the section called “Command Line: Adding a Member to a User Group”)
Important
- The IdM web UI (see the section called “Web UI: Removing a Member from a User Group”)
- The command line (see the section called “Command Line: Removing a Member from a User Group”)
Note
System Security Services Daemon (SSSD) first looks into its cache and performs server lookups only for missing or expired records.
SSSD cache on your host by using the cache purge utility, sss_cache. Using sss_cache to invalidate the current records in the SSSD cache for a host group forces the SSSD cache to retrieve the updated records from the identity provider, so changes can be realized quickly.
SSSD cache:
# sss_cache -n host_group_name
Web UI: Adding a Member to a User or Host Group
- Click → and select or in the left sidebar.
- Click the name of the group.
- Select the type of group member you want to add. For example, Users, User Groups, or External for user groups.

Figure 13.3. Adding User Group Members
- Click .
- Select the member you want to add, and click to confirm.
Command Line: Adding a Member to a User Group
- Optional. Use the
ipa group-findoripa hostgroup-findcommand to find the group. - To add a member to a user group, use the
ipa group-add-membercommand. To add a member to a host group, use theipa hostgroup-add-membercommand.When adding a user group member, specify the member using these options:--usersadds an IdM user--externaladds a user that exists outside the IdM domain, in the format ofDOMAIN\user_nameoruser_name@domain--groupsadds an IdM user group
When adding a host group member, specify the member using these options:--hostsadds an IdM host--groupsadds an IdM host group
Example 13.4. Example commands for adding a member to a user group
To add user1, user2, and group1 to a group named group_name:$ ipa group-add-member group_name --users=user1 --users=user2 --groups=group1
To add ad_user from a domain named ad_domain to a group named group_name, you can choose how to specify the external user. For example:$ ipa group-add-member group_name --external='AD_DOMAIN\ad_user' $ ipa group-add-member group_name --external='ad_user@AD_DOMAIN' $ ipa group-add-member group_name --external='ad_user@AD_DOMAIN.EXAMPLE.COM'
Web UI: Removing a Member from a User Group
- Click → and select or in the left sidebar.
- Click the name of the group.
- Select the type of group member you want to remove. For example, Users, User Groups, or External for user groups.

Figure 13.4. Removing User Group Members
- Select the check box next to the required member.
- Click .
Command Line: Removing a Member from a User Group
- Optional. Use the
ipa group-showoripa hostgroup-showcommand to confirm that the group includes the member you want to remove. - To remove a user group member, use the
ipa group-remove-membercommand. To remove a host group member, use theipa hostgroup-remove-membercommand.When removing a user group member, specify the member using these options:--usersremoves an IdM user--externalremoves a user that exists outside the IdM domain, in the format ofDOMAIN\user_nameoruser_name@domain--groupsremoves an IdM user group
When removing a host group member, specify the member using these options:--hostsremoves an IdM host--groupsremoves an IdM host group
For example, to remove user1, user2, and group1 from a group called group_name:$ ipa group-remove-member group_name --users=user1 --users=user2 --groups=group1
13.4. Disabling User Private Groups
Note
13.4.1. Creating a User without a User Private Group
--noprivate option to the ipa user-add command. Note that for the command to succeed, you must specify a custom private group. See Section 13.4.3, “Adding a User with User Private Groups Disabled”.
13.4.2. Disabling User Private Groups Globally for All Users
- Log in as the administrator:
$ kinit admin
- IdM uses the Directory Server Managed Entries Plug-in to manage user private groups. List the instances of the plug-in:
$ ipa-managed-entries --list
- To ensure IdM does not create user private groups, disabling the plug-in instance responsible for managing user private groups:
$ ipa-managed-entries -e "UPG Definition" disable Disabling Plugin
Note
To re-enable theUPG Definitioninstance later, use theipa-managed-entries -e "UPG Definition" enablecommand. - Restart Directory Server to load the new configuration.
# systemctl restart dirsrv.target
13.4.3. Adding a User with User Private Groups Disabled
- Specify a custom GID when adding a new user. The GID does not have to correspond to an already existing user group.For example, when adding a user from the command line, add the
--gidoption to theipa user-addcommand. - Use an automember rule to add the user to an existing group with a GID. See Section 13.6, “Defining Automatic Group Membership for Users and Hosts”.
13.5. Setting Search Attributes for Users and User Groups
ipa user-find keyword and ipa group-find keyword commands, IdM only searches certain attributes. Most notably:
- In user searches: first name, last name, user name (login ID), job title, organization unit, phone number, UID, email address.
- In group searches: group name, description.
Prerequisites
Web UI: Setting Search Attributes
- Select → .
- In the User Options area, set the user search attributes in User search fields.
- In the Group Options area, set the group search attributes in Group search fields.
- Click at the top of the page.
Command Line: Setting Search Attributes
ipa config-mod command with these options:
--usersearchdefines a new list of search attributes for users--groupsearchdefines a new list of search attributes for groups
$ ipa config-mod --usersearch={uid,givenname,sn,telephonenumber,ou,title}
$ ipa config-mod --groupsearch={cn,description}13.6. Defining Automatic Group Membership for Users and Hosts
13.6.1. How Automatic Group Membership Works in IdM
13.6.1.1. What Automatic Group Membership Is
- Divide employees' user entries into groups based on the employees' manager, location, or any other attribute.
- Divide hosts based on their class, location, or any other attribute.
- Add all users or all hosts to a single global group.
13.6.1.2. Benefits of Automatic Group Membership
- Reduced overhead of managing group membership manually
- With automatic group membership, the administrator no longer assigns users and hosts to groups manually.
- Improved consistency in user and host management
- With automatic group membership, users and hosts are assigned to groups based on strictly defined and automatically evaluated criteria.
- Easier management of group-based settings
- Various settings are defined for groups and then applied to individual group members, for example
sudorules,automount, or access control. When using automatic group membership, users and hosts are automatically added to specified groups, which makes managing group-based settings easier.
13.6.1.3. Automember Rules
- Inclusive conditions
- When a user or host entry meets an inclusive condition, it will be included in the group.
- Exclusive conditions
- When a user or host entry meets an exclusive condition, it will not be included in the group.
13.6.2. Adding an Automember Rule
- The IdM web UI, see the section called “Web UI: Add an Automember Rule”
- The command line, see the section called “Command Line: Add an Automember Rule”
- All entries created in the future will become members of the specified group. If an entry meets conditions specified in multiple automember rules, it will be added to all the corresponding groups.
- Existing entries will not become members of the specified group. See Section 13.6.3, “Applying Automember Rules to Existing Users and Hosts” for more information.
Web UI: Add an Automember Rule
- Select → → or .
- Click .
- In the Automember rule field, select the group to which the rule will apply. Click .
- Define one or more inclusive and exclusive conditions. See Section 13.6.1.3, “Automember Rules” for details.
- In the Inclusive or Exclusive sections, click .
- In the Attribute field, select the required attribute.
- In the Expression field, define the regular expression.
- Click .
For example, the following condition targets all users with any value (.*) in their user login attribute (uid).
Figure 13.5. Adding Automember Rule Conditions
Command Line: Add an Automember Rule
- Use the
ipa automember-addcommand to add an automember rule. When prompted, specify:Automember rule, which matches the target group name.Grouping Type, which specifies whether the rule targets a user group or a host group. To target a user group, entergroup. To target a host group, enterhostgroup.
For example, to add an automember rule for a user group nameduser_group:$ ipa automember-addAutomember Rule:user_groupGrouping Type:group-------------------------------- Added automember rule "user_group" -------------------------------- Automember Rule: user_group - Define one or more inclusive and exclusive conditions. See Section 13.6.1.3, “Automember Rules” for details.
- To add a condition, use the
ipa automember-add-conditioncommand. When prompted, specify:Automember rule, which matches the target group name.Attribute Key, which specifies the entry attribute to which the filter will apply. For example,managerfor users.Grouping Type, which specifies whether the rule targets a user group or a host group. To target a user group, entergroup. To target a host group, enterhostgroup.Inclusive regexandExclusive regex, which specify one or more conditions as regular expressions. If you only want to specify one condition, press Enter when prompted for the other.
For example, the following condition targets all users with any value (.*) in their user login attribute (uid).$ ipa automember-add-conditionAutomember Rule:user_groupAttribute Key:uidGrouping Type:group[Inclusive Regex]:.*[Exclusive Regex]: ---------------------------------- Added condition(s) to "user_group" ---------------------------------- Automember Rule: user_group Inclusive Regex: uid=.* ---------------------------- Number of conditions added 1 ---------------------------- - To remove a condition, use the
ipa automember-remove-conditioncommand.
Example 13.5. Command Line: Creating an Automember Rule to Add All Entries to a Single Group
cn or fqdn, you can ensure that all users or hosts created in the future will be added to a single group.
- Create the group, such as a host group named
all_hosts. See Section 13.2, “Adding and Removing User or Host Groups”. - Add an automember rule for the new host group. For example:
$ ipa automember-addAutomember Rule:all_hostsGrouping Type:hostgroup------------------------------------- Added automember rule "all_hosts" ------------------------------------- Automember Rule: all_hosts - Add an inclusive condition that targets all hosts. In the following example, the inclusive condition targets hosts that have any value (
.*) in thefqdnattribute:$ ipa automember-add-conditionAutomember Rule:all_hostsAttribute Key:fqdnGrouping Type:hostgroup[Inclusive Regex]:.*[Exclusive Regex]: --------------------------------- Added condition(s) to "all_hosts" --------------------------------- Automember Rule: all_hosts Inclusive Regex: fqdn=.* ---------------------------- Number of conditions added 1 ----------------------------
all_hosts group.
Example 13.6. Command Line: Creating an Automember Rule for Synchronized AD Users
ntUser object class. By creating an automember condition that targets all users with ntUser in their objectclass attribute, you can ensure that all synchronized AD users created in the future will be included in a common group for AD users.
- Create a user group for the AD users, such as
ad_users. See Section 13.2, “Adding and Removing User or Host Groups”. - Add an automember rule for the new user group. For example:
$ ipa automember-addAutomember Rule:ad_usersGrouping Type:group------------------------------------- Added automember rule "ad_users" ------------------------------------- Automember Rule: ad_users - Add an inclusive condition to filter the AD users. In the following example, the inclusive condition targets all users that have the
ntUservalue in theobjectclassattribute:$ ipa automember-add-conditionAutomember Rule:ad_usersAttribute Key:objectclassGrouping Type:group[Inclusive Regex]:ntUser[Exclusive Regex]: ------------------------------------- Added condition(s) to "ad_users" ------------------------------------- Automember Rule: ad_users Inclusive Regex: objectclass=ntUser ---------------------------- Number of conditions added 1 ----------------------------
ad_users user group.
13.6.3. Applying Automember Rules to Existing Users and Hosts
Web UI: Rebuild Automatic Membership for Existing Entries
- Select → or .
- Click → .

Figure 13.6. Rebuilding Automatic Membership for All Users or Hosts
- Select → or , and click on the required user login or host name.
- Click → .

Figure 13.7. Rebuilding Automatic Membership for a Single User or Host
Command Line: Rebuild Automatic Memberhips for Existing Entries
ipa automember-rebuild --type=group command:
$ ipa automember-rebuild --type=group
--------------------------------------------------------
Automember rebuild task finished. Processed (9) entries.
--------------------------------------------------------ipa automember-rebuild --type=hostgroup command.
ipa automember-rebuild --users=user command:
$ ipa automember-rebuild --users=user1 --users=user2 -------------------------------------------------------- Automember rebuild task finished. Processed (2) entries. --------------------------------------------------------
ipa automember-rebuild --hosts=example.com command.
13.6.4. Configuring a Default Automember Group
- Use the
ipa automember-default-group-setcommand to configure a default automember group. When prompted, specify:Default (fallback) Group, which specifies the target group name.Grouping Type, which specifies whether the target is a user group or a host group. To target a user group, entergroup. To target a host group, enterhostgroup.
For example:$ ipa automember-default-group-setDefault (fallback) Group:default_user_groupGrouping Type:group--------------------------------------------------- Set default (fallback) group for automember "default_user_group" --------------------------------------------------- Default (fallback) Group: cn=default_user_group,cn=groups,cn=accounts,dc=example,dc=com - To verify that the group is set correctly, use the
ipa automember-default-group-showcommand. The command displays the current default automember group. For example:$ ipa automember-default-group-showGrouping Type:groupDefault (fallback) Group: cn=default_user_group,cn=groups,cn=accounts,dc=example,dc=com
ipa automember-default-group-remove command.
Chapter 14. Unique UID and GID Number Assignments
14.1. ID Ranges
next ID range that the server or replica uses after the current range has been depleted. For more information about the DNA Directory Server plug-in, see the Red Hat Directory Server Deployment Guide.
14.2. ID Range Assignments During Installation
ipa-server-install command by default automatically assigns a random current ID range to the installed server. The setup script randomly selects a range of 200,000 IDs from a total of 10,000 possible ranges. Selecting a random range in this way significantly reduces the probability of conflicting IDs in case you decide to merge two separate IdM domains in the future.
ipa-server-install:
--idstartgives the starting value for UID and GID numbers; by default, the value is selected at random,--idmaxgives the maximum UID and GID number; by default, the value is the--idstartstarting value plus 199,999.
Note
14.3. Displaying Currently Assigned ID Ranges
ipa-replica-manage dnarange-showdisplays the current ID range that is set on all servers or, if you specify a server, only on the specified server, for example:# ipa-replica-manage dnarange-show masterA.example.com: 1001-1500 masterB.example.com: 1501-2000 masterC.example.com: No range set # ipa-replica-manage dnarange-show masterA.example.com masterA.example.com: 1001-1500
ipa-replica-manage dnanextrange-showdisplays the next ID range currently set on all servers or, if you specify a server, only on the specified server, for example:# ipa-replica-manage dnanextrange-show masterA.example.com: 1001-1500 masterB.example.com: No on-deck range set masterC.example.com: No on-deck range set # ipa-replica-manage dnanextrange-show masterA.example.com masterA.example.com: 1001-1500
14.4. Automatic ID Range Extension After Deleting a Replica
ipa-replica-manage del command retrieves the ID ranges that were assigned to the replica and adds them as a next range to other available IdM replicas. This ensures that ID ranges remain available to be used by other replicas.
ipa-replica-manage dnarange-show and ipa-replica-manage dnanextrange-show commands, described in Section 14.3, “Displaying Currently Assigned ID Ranges”.
14.5. Manual ID Range Extension and Assigning a New ID Range
- An assigned ID range has been depleted
- A replica has exhausted the ID range that was assigned to it, and requesting additional IDs failed because no more free IDs are available in the ID ranges of other replicas. You want to extend the ID range assigned to the replica. This might involve splitting an existing ID range or extending it past the initial configured ID range for the server. Alternatively, you might want to assign a new ID range.
Note
If you assign a new ID range, the UIDs of the already existing entries on the server or replica stay the same. This does not pose a problem because even if you change the current ID range, IdM keeps a record of what ranges were assigned in the past. - A replica stopped functioning
- ID range is not automatically retrieved when a replica dies and needs to be deleted, which means the ID range previously assigned to the replica becomes unavailable. You want to recover the ID range and make it available for other replicas.If you want to recover the ID range belonging to a server that stopped functioning and assign it to another server, first find out what are the ID range values using the
ipa-replica-manage dnarange-showcommand described in Section 14.3, “Displaying Currently Assigned ID Ranges”, and then manually assign that ID range to the server. Also, to avoid duplicate UIDs or GIDs, make sure that no ID value from the recovered range was previously assigned to a user or group; you can do this by examining the UIDs and GIDs of existent users and groups.
ipa-replica-manage dnarange-setallows you to define the current ID range for a specified server:# ipa-replica-manage dnarange-set masterA.example.com 1250-1499
ipa-replica-manage dnanextrange-setallows you to define the next ID range for a specified server:# ipa-replica-manage dnanextrange-set masterB.example.com 1001-5000
Important
0 value; the SSSD service does not handle the 0 ID value.
ipa idrange-find command. Run the ipa idrange-find -h command to display help for how to use ipa idrange-find.
14.6. Ensuring That ID Values Are Unique
- Automatic ID assignment
- When a user or a group is created interactively or without a manually specified ID number, the server assigns the next available ID number from the ID range to the user account. This ensures that the UID or GID is always unique.
- Manual ID assignment
- When you assign an ID to a user or a group entry manually, the server does not verify that the specified UID or GID is unique; it does not warn you of a conflict if you choose a value that is already used by another entry.
ipa user-find --all command, both entries are returned.
uidNumber and gidNumber.
Note
14.7. Repairing Changed UID and GID Numbers
sss_cache utility as follows:
[root@server ~]# sss_cache -u user
Chapter 15. User and Group Schema
Table 15.1. Default Identity Management User Object Classes
| Object Classes | Description |
|---|---|
|
ipaobject
ipasshuser
| IdM object classes |
|
person
organizationalperson
inetorgperson
inetuser
posixAccount
| Person object classes |
|
krbprincipalaux
krbticketpolicyaux
| Kerberos object classes |
| mepOriginEntry | Managed entries (template) object classes |
Table 15.2. Default Identity Management User Attributes
| UI Field | Command-Line Option | Required, Optional, or Default[a] |
|---|---|---|
| User login | username | Required |
| First name | --first | Required |
| Last name | --last | Required |
| Full name | --cn | Optional |
| Display name | --displayname | Optional |
| Initials | --initials | Default |
| Home directory | --homedir | Default |
| GECOS field | --gecos | Default |
| Shell | --shell | Default |
| Kerberos principal | --principal | Default |
| Email address | --email | Optional |
| Password | --password [b] | Optional |
| User ID number | --uid | Default |
| Group ID number | --gidnumber | Default |
| Street address | --street | Optional |
| City | --city | Optional |
| State/Province | --state | Optional |
| Zip code | --postalcode | Optional |
| Telephone number | --phone | Optional |
| Mobile telephone number | --mobile | Optional |
| Pager number | --pager | Optional |
| Fax number | --fax | Optional |
| Organizational unit | --orgunit | Optional |
| Job title | --title | Optional |
| Manager | --manager | Optional |
| Car license | --carlicense | Optional |
--noprivate | Optional | |
| SSH Keys | --sshpubkey | Optional |
| Additional attributes | --addattr | Optional |
| Department Number | --departmentnumber | Optional |
| Employee Number | --employeenumber | Optional |
| Employee Type | --employeetype | Optional |
| Preferred Language | --preferredlanguage | Optional |
[a]
Required attributes must be set for every entry. Optional attributes may be set, while default attributes are automatically added with a predefined value unless a specific value is given.
[b]
The script prompts for the new password, rather than accepting a value with the argument.
| ||
15.1. About Changing the Default User and Group Schema
- All of the object classes and their specified attributes must be known to the LDAP server.
- All default attributes that are configured for the entry must be supported by the configured object classes.
ipaobject object class. However, when the user or group schema is changed, the server does not check to make sure that this object class is included; if the object class is accidentally deleted, then future entry add operations will fail.
15.2. Applying Custom Object Classes to New User Entries
15.2.1. From the Web UI
- Add all of the custom schema elements to the 389 Directory Server instance used by Identity Management. Adding schema elements is described in the schema chapter of the Directory Server Administrator's Guide.
- Open the IPA Server tab.
- Select the Configuration subtab.
- Scroll to the User Options area.

Figure 15.1. User Options in Server Configuration
- At the bottom of the users area, click Add to include a new field for another object class.
Important
Always include the existing default object classes when the configuration is updated. Otherwise, the current settings will be overwritten. If any object classes required by Identity Management are not included, then subsequent attempts to add an entry will fail with object class violations.
Figure 15.2. Changing Default User Object Classes
- When the changes are complete, click Save at the top of the Configuration page.
15.2.2. From the Command Line
- Add all of the custom schema elements to the 389 Directory Server instance used by Identity Management. Adding schema elements is described in the schema chapter of the Directory Server Administrator's Guide.
- Add the new object class to the list of object classes added to entries. The option for user object classes is
--userobjectclasses.Important
Always include the existing default object classes when the configuration is updated. Otherwise, the current settings will be overwritten. If any object classes required by Identity Management are not included, then subsequent attempts to add an entry will fail with object class violations.All object classes must be included in the list of object classes. The information passed with theconfig-modcommand overwrites the previous values. This can be done by specifying each object class with a--userobjectclassesargument or by listing all of the object classes in a comma-separated list inside curly braces with no spaces allowed, such as {attr1,attr2,attr3}. Especially for long lists, it can be easier to use the curly braces than multiple options. For example:[bjensen@server ~]$ ipa config-mod
--userobjectclasses={top,person,organizationalperson,inetorgperson,inetuser,posixaccount,krbprincipalaux,krbticketpolicyaux,ipaobject,ipasshuser,employeeinfo}
Note
brace expansion feature must be switched on. To activate the feature, use the set command:
# set -o braceexpand
15.3. Applying Custom Object Classes to New Group Entries
15.3.1. From the Web UI
- Add all of the custom schema elements to the 389 Directory Server instance used by Identity Management. Adding schema elements is described in the schema chapter of the Directory Server Administrator's Guide.
- Open the IPA Server tab.
- Select the Configuration subtab.
- Scroll to the Group Options area.

Figure 15.3. Group Options in Server Configuration
- Click Add to include a new field for another object class.
Important
Always include the existing default object classes when the configuration is updated. Otherwise, the current settings will be overwritten. If any object classes required by Identity Management are not included, then subsequent attempts to add an entry will fail with object class violations. - When the changes are complete, click Save at the top of the Configuration page.
15.3.2. From the Command Line
- Add all of the custom schema elements to the 389 Directory Server instance used by Identity Management. Adding schema elements is described in the schema chapter of the Directory Server Administrator's Guide.
- Add the new object class to the list of object classes added to entries. The option for group object classes is
--groupobjectclasses.Important
Always include the existing default object classes when the configuration is updated. Otherwise, the current settings will be overwritten. If any object classes required by Identity Management are not included, then subsequent attempts to add an entry will fail with object class violations.All object classes must be included in the list of object classes. The information passed with theconfig-modcommand overwrites the previous values. This can be done by specifying each object class with a--groupobjectclassesargument or by listing all of the object classes in a comma-separated list inside curly braces with no spaces allowed, such as {attr1,attr2,attr3}. Especially for long lists, it can be easier to use the curly braces than multiple options. For example:[bjensen@server ~]$ ipa config-mod
--groupobjectclasses={top,groupofnames,nestedgroup,ipausergroup,ipaobject,ipasshuser,employeegroup}
15.4. Specifying Default User and Group Attributes
cn=ipaconfig,cn=etc,dc=example,dc=com.
ipa config-mod command.
Table 15.3. Default User Parameters
| Field | Command-Line Option | Descriptions |
|---|---|---|
| Maximum user name length | --maxusername | Sets the maximum number of characters for user names. The default value is 32. |
| Root for home directories | --homedirectory | Sets the default directory to use for user home directories. The default value is /home. |
| Default shell | --defaultshell | Sets the default shell to use for users. The default value is /bin/sh. |
| Default user group | --defaultgroup | Sets the default group to which all newly created accounts are added. The default value is ipausers, which is automatically created during the IdM server installation process. |
| Default e-mail domain | --emaildomain | Sets the email domain to use to create email addresses based on the new accounts. The default is the IdM server domain. |
| Search time limit | --searchtimelimit | Sets the maximum amount of time, in seconds, to spend on a search before the server returns results. |
| Search size limit | --searchrecordslimit | Sets the maximum number of records to return in a search. |
| User search fields | --usersearch | Sets the fields in a user entry that can be used as a search string. Any attribute listed has an index kept for that attribute, so setting too many attributes could affect server performance. |
| Group search fields | --groupsearch | Sets the fields in a group entry that can be used as a search string. |
| Certificate subject base | Sets the base DN to use when creating subject DNs for client certificates. This is configured when the server is set up. | |
| Default user object classes | --userobjectclasses | Defines an object class that is used to create IdM user accounts. This can be invoked multiple times. The complete list of object classes must be given because the list is overwritten when the command is run. |
| Default group object classes | --groupobjectclasses | Defines an object class that is used to create IdM group accounts. This can be invoked multiple times. The complete list of object classes must be given because the list is overwritten when the command is run. |
| Password expiration notification | --pwdexpnotify | Sets how long, in days, before a password expires for the server to send a notification. |
| Password plug-in features | Sets the format of passwords that are allowed for users. |
15.4.1. Viewing Attributes from the Web UI
- Open the IPA Server tab.
- Select the Configuration subtab.
- The complete configuration entry is shown in three sections, one for all search limits, one for user templates, and one for group templates.

Figure 15.4. Setting Search Limits

Figure 15.5. User Attributes

Figure 15.6. Group Attributes
15.4.2. Viewing Attributes from the Command Line
config-show command shows the current configuration which applies to all new user accounts. By default, only the most common attributes are displayed; use the --all option to show the complete configuration.
[bjensen@server ~]$ kinit admin [bjensen@server ~]$ ipa config-show --all dn: cn=ipaConfig,cn=etc,dc=example,dc=com Maximum username length: 32 Home directory base: /home Default shell: /bin/sh Default users group: ipausers Default e-mail domain: example.com Search time limit: 2 Search size limit: 100 User search fields: uid,givenname,sn,telephonenumber,ou,title Group search fields: cn,description Enable migration mode: FALSE Certificate Subject base: O=EXAMPLE.COM Default group objectclasses: top, groupofnames, nestedgroup, ipausergroup, ipaobject Default user objectclasses: top, person, organizationalperson, inetorgperson, inetuser, posixaccount, krbprincipalaux, krbticketpolicyaux, ipaobject, ipasshuser Password Expiration Notification (days): 4 Password plugin features: AllowNThash SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023 Default SELinux user: unconfined_u:s0-s0:c0.c1023 Default PAC types: MS-PAC, nfs:NONE cn: ipaConfig objectclass: nsContainer, top, ipaGuiConfig, ipaConfigObject
Chapter 16. Managing Services
- DNS
- Kerberos
- Certificate management
16.1. Adding and Editing Service Entries and Keytabs
/etc/httpd/conf/ipa.keytab.
Note
ipa.keytab and that keytab file is deleted, the IdM web UI will stop working, because the original key would also be deleted.
ipa-getkeytab, you should avoid using /etc/krb5.keytab. This file should not contain service-specific keytabs; each service should have its keytab saved in a specific location and the access privileges (and possibly SELinux rules) should be configured so that only this service has access to the keytab.
16.1.1. Adding Services and Keytabs from the Web UI
- Open the Identity tab, and select the Services subtab.
- Click the button at the top of the services list.
- Select the service type from the drop-down menu, and give it a name.
- Select the host name of the IdM host on which the service is running. The host name is used to construct the full service principal name.
- Click the button to save the new service principal.
- Use the
ipa-getkeytabcommand to generate and assign the new keytab for the service principal.[root@ipaserver ~]# # ipa-getkeytab -s ipaserver.example.com -p HTTP/server.example.com -k /etc/httpd/conf/krb5.keytab -e aes256-cts
- The realm name is optional. The IdM server automatically appends the Kerberos realm for which it is configured. You cannot specify a different realm.
- The host name must resolve to a DNS A record for it to work with Kerberos. You can use the
--forceflag to force the creation of a principal should this prove necessary. - The
-eargument can include a list of encryption types to include in the keytab. This supersedes any default encryption type. Lists of entries can be set by using the option multiple times with the same command invocation or by listing the options in a comma-separated list inside curly braces, such as --option={val1,val2,val3}.
Warning
Creating a new key resets the secret for the specified principal. This means that all other keytabs for that principal are rendered invalid.
16.1.2. Adding Services and Keytabs from the Command Line
- Create the service principal. The service is recognized through a name like service/FQDN:
# ipa service-add serviceName/hostname
For example:$ ipa service-add HTTP/server.example.com ------------------------------------------------------- Added service "HTTP/server.example.com@EXAMPLE.COM" ------------------------------------------------------- Principal: HTTP/server.example.com@EXAMPLE.COM Managed by: ipaserver.example.com
- Create the service keytab file using the
ipa-getkeytabcommand. This command is run on the client in the IdM domain. (Actually, it can be run on any IdM server or client, and then the keys copied to the appropriate machine. However, it is simplest to run the command on the machine with the service being created.)The command requires the Kerberos service principal (-p), the IdM server name (-s), the file to write (-k), and the encryption method (-e). Be sure to copy the keytab to the appropriate directory for the service.For example:# ipa-getkeytab -s server.example.com -p HTTP/server.example.com -k /etc/httpd/conf/krb5.keytab -e aes256-cts
- The realm name is optional. The IdM server automatically appends the Kerberos realm for which it is configured. You cannot specify a different realm.
- The host name must resolve to a DNS A record for it to work with Kerberos. You can use the
--forceflag to force the creation of a principal should this prove necessary. - The
-eargument can include a comma-separated list of encryption types to include in the keytab. This supersedes any default encryption type. Lists of entries can be set by using the option multiple times with the same command invocation or by listing the options in a comma-separated list inside curly braces, such as --option={val1,val2,val3}.
Warning
Theipa-getkeytabcommand resets the secret for the specified principal. This means that all other keytabs for that principal are rendered invalid.
16.2. Configuring Clustered Services
- Enroll all of the hosts in the cluster into the IdM domain.
- Create any service principals and generate the required keytabs.
- Collect any keytabs that have been set up for services on the host, including the host keytab at
/etc/krb5.keytab. - Use the
ktutilcommand to produce a single keytab file that contains the contents of all of the keytab files.- For each file, use the
rktcommand to read the keys from that file. - Use the
wktcommand to write all of the keys which have been read to a new keytab file.
- Replace the keytab files on each host with the newly-created combined keytab file.
- At this point, each host in this cluster can now impersonate any other host.
- Some services require additional configuration to accommodate cluster members which do not reset host names when taking over a failed service.
- For
sshd, setGSSAPIStrictAcceptorCheck noin/etc/ssh/sshd_config. - For
mod_auth_kerb, setKrbServiceName Anyin/etc/httpd/conf.d/auth_kerb.conf.
Note
16.3. Using the Same Service Principal for Multiple Services
- Retrieve a service principal using the
ipa-getkeytabcommand.# ipa-getkeytab -s kdc.example.com -p HTTP/server.example.com -k /etc/httpd/conf/krb5.keytab -e aes256-cts
- Either direct multiple servers or services to use the same file, or copy the file to individual servers as required.
16.4. Retrieve Existing Keytabs for Multiple Servers
- Authenticate as
adminuser:[root@ipaserver ~]# kinit admin
- Add a common forward DNS record for all IP addresses that share this host name:
[root@ipaserver ~]# ipa dnsrecord-add idm.example.com cluster --a-rec={192.0.2.40,192.0.2.41} Record name: cluster A record: 192.0.2.40, 192.0.2.41 - Create a new host entry object for the common DNS name:
[root@ipaserver ~]# ipa host-add cluster.idm.example.com ------------------------------------ Added host "cluster.idm.example.com" ------------------------------------ Host name: cluster.idm.example.com Principal name: host/cluster.idm.example.com@IDM.EXAMPLE.COM Password: False Keytab: False Managed by: cluster.idm.example.com
- Add the service principal for the host:
[root@ipaserver ~]# ipa service-add HTTP/cluster.idm.example.com ------------------------------------------------------------ Added service "HTTP/cluster.idm.example.com@IDM.EXAMPLE.COM" ------------------------------------------------------------ Principal: HTTP/cluster.idm.example.com@IDM.EXAMPLE.COM Managed by: cluster.idm.example.com
- Add the hosts to the service, that should be able to retrieve the keytab from IdM:
[root@ipaserver ~]# ipa service-allow-retrieve-keytab HTTP/cluster.idm.example.com --hosts={node01.idm.example.com,node02.idm.example.com} Principal: HTTP/cluster.idm.example.com@IDM.EXAMPLE.COM Managed by: cluster.idm.example.com Hosts allowed to retrieve keytab: node01.idm.example.com, node02.idm.example.com ------------------------- Number of members added 2 ------------------------- - Grant permission to create a new keytab to one host:
[root@ipaserver ~]# ipa service-allow-create-keytab HTTP/cluster.idm.example.com --hosts=node01.idm.example.com Principal: HTTP/cluster.idm.example.com@IDM.EXAMPLE.COM Managed by: cluster.idm.example.com Hosts allowed to retrieve keytab: node01.idm.example.com, node02.idm.example.com Hosts allowed to create keytab: node01.idm.example.com ------------------------- Number of members added 1 -------------------------
- Authenticate with the hosts Kerberos keytab:
# kinit -kt /etc/krb5.keytab
- On the client you granted the respective permission to, generate a new keytab and store it in a file:
[root@node01 ~]# ipa-getkeytab -s ipaserver.idm.example.com -p HTTP/cluster.idm.example.com -k /tmp/client.keytab
- On all other clients, retrieve the existing keytab from the IdM server by adding the
-roption to the command:[root@node02 ~]# ipa-getkeytab -r -s ipaserver.idm.example.com -p HTTP/cluster.idm.example.com -k /tmp/client.keytab
Warning
Be aware that if you omit the-roption, a new keytab will be generated. This invalidates all previously retrieved keytabs for this service principal.
16.5. Disabling and Re-enabling Service Entries
16.5.1. Disabling Service Entries
service-disable command.
[jsmith@ipaserver ~]$ kinit admin [jsmith@ipaserver ~]$ ipa service-disable HTTP/server.example.com
Important
16.5.2. Re-enabling Services
ipa-getkeytab command. The -s option sets which IdM server to request the keytab, -p gives the principal name, and -k gives the file to which to save the keytab.
[root@ipaserver ~]# ipa-getkeytab -s ipaserver.example.com -p HTTP/server.example.com -k /etc/httpd/conf/krb5.keytab -e aes256-cts
Chapter 17. Delegating Access to Hosts and Services
managedby entry which lists what hosts or services can manage it. By default, a host can manage itself and all of its services. It is also possible to allow a host to manage other hosts, or services on other hosts, by updating the appropriate delegations or providing a suitable managedby entry.

Figure 17.1. Host and Service Delegation
Note
managedBy entry, it does not mean that the host has also been delegated management for all services on that host. Each delegation has to be performed independently.
17.1. Delegating Service Management
service-add-host utility:
# ipa service-add-host principal --hosts=hostname
- Specifying the principal using the principal argument.
- Identifying the hosts with the control using the
--hostsoption.
[root@server ~]# ipa service-add HTTP/web.example.com [root@server ~]# ipa service-add-host HTTP/web.example.com --hosts=client1.example.com
[root@client1 ~]# kinit -kt /etc/krb5.keytab host/client1.example.com [root@client1 ~]# ipa-getkeytab -s server.example.com -k /tmp/test.keytab -p HTTP/web.example.com Keytab successfully retrieved and stored in: /tmp/test.keytab
[root@client1]# kinit -kt /etc/krb5.keytab host/client1.example.com [root@client1]# openssl req -newkey rsa:2048 -subj '/CN=web.example.com/O=EXAMPLE.COM' -keyout /etc/pki/tls/web.key -out /tmp/web.csr -nodes Generating a 2048 bit RSA private key .............................................................+++ ............................................................................................+++ Writing new private key to '/etc/pki/tls/private/web.key'
cert-request utility to create a service entry and load the certification information:
[root@client1]# ipa cert-request --principal=HTTP/web.example.com web.csr Certificate: MIICETCCAXqgA...[snip] Subject: CN=web.example.com,O=EXAMPLE.COM Issuer: CN=EXAMPLE.COM Certificate Authority Not Before: Tue Feb 08 18:51:51 2011 UTC Not After: Mon Feb 08 18:51:51 2016 UTC Serial number: 1005
ipa cert-request, see Section 24.1.1, “Requesting New Certificates for a User, Host, or Service”.
17.2. Delegating Host Management
host-add-managedby utility. This creates a managedby entry. Once the managedby entry is created, then the host can retrieve a keytab for the host over which t has delegated authority.
- Log in as the admin user.
[root@server ~]# kinit admin
- Add the
managedbyentry. For example, this delegates authority over client2 to client1.[root@server ~]# ipa host-add-managedby client2.example.com --hosts=client1.example.com
- Obtain a ticket as the host
client1:[root@client1 ~]# kinit -kt /etc/krb5.keytab host/client1.example.com
- Retrieve a keytab for
client2:[root@client1 ~]# ipa-getkeytab -s server.example.com -k /tmp/client2.keytab -p host/client2.example.com Keytab successfully retrieved and stored in: /tmp/client2.keytab
17.3. Delegating Host or Service Management in the Web UI
- Open the Identity tab, and select the Hosts or Services subtab.
- Click the name of the host or service that you are going to grant delegated management to.
- Click the Hosts subtab on the far right of the host or service entry. This is the tab which lists hosts that can manage the selected host or service.

Figure 17.2. Host Subtab
- Click the Add link at the top of the list.
- Click the check box by the names of the hosts to which to delegate management for the host or service. Click the right arrow button, , to move the hosts to the selection box.

Figure 17.3. Host/Service Delegation Management
- Click the button to close the selection box and to save the delegation settings.
17.4. Accessing Delegated Services
host.
kinit, use the -k option to load a keytab and the -t option to specify the keytab. For example:
[root@server ~]# kinit -kt /etc/krb5.keytab host/ipa.example.com@EXAMPLE.COM
[root@server ~]# kinit -kt /etc/httpd/conf/krb5.keytab HTTP/ipa.example.com@EXAMPLE.COM
Chapter 18. ID Views
- define different attribute values for different environments; see Section 18.3, “Defining a Different Attribute Value for a User Account on Different Hosts”
- replace a previously generated attribute value with a different value
Important
Potential Negative Impact on SSSD Performance
- With ID views, SSSD must check every member on the returned list of group member names if the group name is overridden.
- Without ID views, SSSD can only collect the user names from the member attribute of the group object.
Additional Resources
18.1. Attributes an ID View Can Override
- User attributes
- Login name (
uid) - GECOS entry (
gecos) - UID number (
uidNumber) - GID number (
gidNumber) - Login shell (
loginShell) - Home directory (
homeDirectory) - SSH public keys (
ipaSshPubkey) - Certificate (
userCertificate)
- Group attributes
- Group name (
cn) - Group GID number (
gidNumber)
18.2. Getting Help for ID View Commands
$ ipa help idviews
--help option to the command:
$ ipa idview-add --help
18.3. Defining a Different Attribute Value for a User Account on Different Hosts
host1.example.com. To override the attribute values on the other hosts as well, use the procedures to create multiple ID views, one for each host.
useris the user account whose attribute needs to be overriddenhost1.example.comis the host on which the ID view will be applied
Important
18.3.1. Web UI: Overriding an Attribute Value for a Specific Host
admin.
Creating a New ID View
- Under the Identity tab, select the ID Views subtab.
- Click and provide a name for the ID view.

Figure 18.1. Adding an ID View
- Click to confirm.

Figure 18.2. List of ID Views
Adding a User Override to the ID View
- In the list of ID views, click the name of the ID view.

Figure 18.3. Editing an ID View
- Under the Users tab, click to add the user override.
- Select the user account whose attribute value to override, and click .
example_for_host1 ID view page.

Figure 18.4. List of Overrides
Specifying the Attribute to Override
- Click the override that you want to use to change the attribute value.

Figure 18.5. Editing an Override
- Define the new value for the attribute.For example, to override the SSH public key used by the user account:
- Click .

Figure 18.6. Adding an SSH Public Key
- Paste in the public key.
Note
For details on adding SSH keys to IdM, see Section 22.4, “Managing Public SSH Keys for Users”. - Click to update the override.
Applying the ID View to a Specific Host
- In the list of ID views, click the name of the ID view.

Figure 18.7. Editing an ID View
- Under the Hosts tab, click .
- Select the
host1.example.comhost, and move it to the Prospective column. - Click .

Figure 18.8. Listing Hosts to Which an ID View Applies
18.3.2. Command Line: Overriding an Attribute Value for a Specific Host
$ kinit admin
- Create a new ID view. For example, the create an ID view named
example_for_host1:$ ipa idview-add example_for_host1 --------------------------- Added ID View "example_for_host1" --------------------------- ID View Name: example_for_host1
- Add a user override to the
example_for_host1ID view. Theipa idoverrideuser-addcommand requires the name of the ID view and the user to override.- To specify the new attribute value, add the corresponding command-line option as well. For a list of the available options, run
ipa idoverrideuser-add --help. For example, use the--sshpubkeyoption to override the SSH public key value:$ ipa idoverrideuser-add example_for_host1 user --sshpubkey="ssh-rsa AAAAB3NzaC1yrRqFE...gWRL71/miPIZ user@example.com" ----------------------------- Added User ID override "user" ----------------------------- Anchor to override: user SSH public key: ssh-rsa AAAB3NzaC1yrRqFE...gWRL71/miPIZ user@example.comNote
For details on adding SSH keys to IdM, see Section 22.4, “Managing Public SSH Keys for Users”. - The
ipa idoverrideuser-add --certificatecommand replaces all existing certificates for the account in the specified ID view. To append an additional certificate, use theipa idoverrideuser-add-certcommand instead:$ ipa idoverrideuser-add-cert example_for_host1 user --certificate="MIIEATCC..."
- Using the
ipa idoverrideuser-modcommand, you can also specify new attribute values for an existing user override.
- Apply
example_for_host1to thehost1.example.comhost:$ ipa idview-apply example_for_host1 --hosts=host1.example.com ----------------------------- Applied ID View "example_for_host1" ----------------------------- hosts: host1.example.com --------------------------------------------- Number of hosts the ID View was applied to: 1 ---------------------------------------------
Note
Theipa idview-applycommand also accepts the--hostgroupsoption. The option applies the ID view to hosts that belong to the specified host group, but does not associate the ID view with the host group itself. Instead, the--hostgroupsoption expands the members of the specified host group and applies the--hostsoption individually to every one of them.
Chapter 19. Defining Access Control for IdM Users
Chapter 20. Managing Kerberos Flags and Principal Aliases
20.1. Kerberos Flags for Services and Hosts
OK_AS_DELEGATE- Use this flag to specify Kerberos tickets trusted for delegation.Active directory (AD) clients check the
OK_AS_DELEGATEflag on the Kerberos ticket to determine whether the user credentials can be forwarded or delegated to the specific server. AD forwards the ticket-granting ticket (TGT) only to services or hosts withOK_AS_DELEGATEset. With this flag, system security services daemon (SSSD) can add the AD user TGT to the default Kerberos credentials cache on the IdM client machine. REQUIRES_PRE_AUTH- Use this flag to specify that only pre-authenticated tickets are allowed to authenticate to the principal.With the
REQUIRES_PRE_AUTHflag set, the key distribution center (KDC) requires additional authentication: the KDC issues the TGT for a principal withREQUIRES_PRE_AUTHonly if the TGT has been pre-authenticated.You can clearREQUIRES_PRE_AUTHto disable pre-authentication for selected services or hosts, which lowers the load on the KDC but also slightly increases the possibility of a brute-force attack on a long-term key to succeed. OK_TO_AUTH_AS_DELEGATE- Use the
OK_TO_AUTH_AS_DELEGATEflag to specify that the service is allowed to obtain a kerberos ticket on behalf of the user. Note, that while this is enough to perform protocol transition, in order to obtain other tickets on behalf of the user, the service needs theOK_AS_DELEGATEflag and a corresponding policy decision allowed on the key distribution center side.
20.1.1. Setting Kerberos Flags from the Web UI
OK_AS_DELEGATE, REQUIRES_PRE_AUTH, or OK_TO_AUTH_AS_DELEGATE to a principal:
- Select the Services subtab, accessible through the Identity main tab.

Figure 20.1. List of Services
- Click on the service to which you want to add the flags.
- Check the option that you want to set. For example, to set the
REQUIRES_PRE_AUTHflag, check the Requires pre-authentication option:
Figure 20.2. Adding the
REQUIRES_PRE_AUTHflagThe following table lists the names of the Kerberos flags and the corresponding name in the Web UI:Table 20.1. Kerberos flags' mapping in WebUI
Kerberos flag name Web UI option OK_AS_DELEGATE Trusted for delegation REQUIRES_PRE_AUTH Requires pre-authentication OK_TO_AUTH_AS_DELEGATE Trusted to authenticate as user
20.1.2. Setting and Removing Kerberos Flags from the Command Line
ipa service-mod command:
--ok-as-delegateforOK_AS_DELEGATE--requires-pre-authforREQUIRES_PRE_AUTH--ok-to-auth-as-delegateforOK_TO_AUTH_AS_DELEGATE
1. For example, to add the OK_AS_DELEGATE flag to the service/ipa.example.com@EXAMPLE.COM principal:
$ ipa service-mod service/ipa.example.com@EXAMPLE.COM --ok-as-delegate=10. For example, to disable the REQUIRES_PRE_AUTH flag for the test/ipa.example.com@EXAMPLE.COM principal:
$ ipa service-mod test/ipa.example.com@EXAMPLE.COM --requires-pre-auth=020.1.3. Displaying Kerberos Flags from the Command Line
OK_AS_DELEGATE is currently set for a principal:
- Run the
kvnoutility. - Run the
klist -fcommand.
OK_AS_DELEGATE is represented by the O character in the klist -f output:
$ kvno test/ipa.example.com@EXAMPLE.COM
$ klist -f
Ticket cache: KEYRING:persistent:0:0
Default principal: admin@EXAMPLE.COM
Valid starting Expires Service principal
02/19/2014 09:59:02 02/20/2014 08:21:33 test/ipa/example.com@EXAMPLE.COM
Flags: FATOTable 20.2. Abbreviations for kerberos flags
| Kerberos flag name | Abbreviation |
|---|---|
| OK_AS_DELEGATE | O |
| REQUIRES_PRE_AUTH | A |
| OK_TO_AUTH_AS_DELEGATE | F |
kadmin.local utility. The current flags are displayed on the Attributes line of kadmin.local output, for example:
# kadmin.local
kadmin.local: getprinc test/ipa.example.com
Principal: test/ipa.example.com@EXAMPLE.COM
Expiration date: [never]
...
Attributes: REQUIRES_PRE_AUTH OK_AS_DELEGATE OK_TO_AUTH_AS_DELEGATE
Policy: [none]
20.2. Managing Kerberos Principal Aliases for Users, Hosts, and Services
- user_name@REALM
- host/host_name@REALM
- service_name/host_name@REALM
- The user name changed, but the user should be able to login using both the previous and new user name.
- The user needs to log in using the email address even if the IdM Kerberos realm differs from the email domain.
20.2.1. Kerberos Principal Alias
Adding a Kerberos Principal Alias
useralias to the account user, enter:
[root@ipaserver ~]# ipa user-add-principal user useralias
--------------------------------
Added new aliases to user "user"
--------------------------------
User login: user
Principal alias: user@IDM.EXAMPLE.COM, useralias@IDM.EXAMPLE.COMipa host-add-principal or ipa service-add-principal command respectively instead.
-C option to the kinit command:
[root@ipaserver ~]# kinit -C useralias Password for user@IDM.EXAMPLE.COM:
Removing a Kerberos Principal Alias
useralias from the account user, enter:
[root@ipaserver ~]# ipa user-remove-principal user useralias -------------------------------- Removed aliases from user "user" -------------------------------- User login: user Principal alias: user@IDM.EXAMPLE.COM
ipa host-remove-principal or ipa service-remove-principal command respectively instead.
[root@ipaserver ~]# ipa user-show user User login: user ... Principal name: user@IDM.EXAMPLE.COM ... [root@ipaserver ~]# ipa user-remove-principal user user ipa: ERROR: invalid 'krbprincipalname': at least one value equal to the canonical principal name must be present
20.2.2. Kerberos Enterprise Principal Alias
Note
@ symbol using two backslashes (\\). Otherwise, the shell interprets the @ symbol as part of the Kerberos realm name and leads to the following error:
ipa: ERROR: The realm for the principal does not match the realm for this IPA server
Adding a Kerberos Enterprise Principal Alias
user@example.com to the user account:
[root@ipaserver ~]# ipa user-add-principal user user\\@example.com
--------------------------------
Added new aliases to user "user"
--------------------------------
User login: user
Principal alias: user@IDM.EXAMPLE.COM, user\@example.com@IDM.EXAMPLE.COMipa host-add-principal or ipa service-add-principal command respectively instead.
-E option to the kinit command:
[root@ipaserver ~]# kinit -E user@example.com Password for user\@example.com@IDM.EXAMPLE.COM:
Removing a Kerberos Enterprise Principal Alias
user@example.com from the account user, enter:
[root@ipaserver ~]# ipa user-remove-principal user user\\@example.com -------------------------------- Removed aliases from user "user" -------------------------------- User login: user Principal alias: user@IDM.EXAMPLE.COM
ipa host-remove-principal or ipa service-remove-principal command respectively instead.
Chapter 21. Integrating with NIS Domains and Netgroups
21.1. About NIS and Identity Management
- Users and passwords
- Host names and IP addresses
- POSIX groups.
NIS in Identity Management
nss_ldap using an encrypted LDAP connection.
NIS Plug-ins in Identity Management
- NIS Server Plug-in
- The NIS Server plug-in enables the IdM-integrated LDAP server to act as a NIS server for clients. In this role, Directory Server dynamically generates and updates NIS maps according to the configuration. Using the plug-in, IdM serves clients using the NIS protocol as an NIS server.For further details, see Section 21.2, “Enabling NIS in Identity Management”.
- Schema Compatibility Plug-in
- The Schema Compatibility plug-in enables the Directory Server back end to provide an alternate view of entries stored in part of the directory information tree (DIT). This includes adding, dropping, or renaming attribute values, and optionally retrieving values for attributes from multiple entries in the tree.For further details, see the
/usr/share/doc/slapi-nis-version/sch-getting-started.txtfile.
21.1.1. NIS Netgroups in Identity Management
- Nested groups (groups as members of other groups).
- Grouping hosts.
- A value.
- A dash (
-), which specifies "no valid value" - No value. An empty field specifies a wildcard.
(host.example.com,,nisdomain.example.com) (-,user,nisdomain.example.com)
- to a traditional NIS map and sends it to the client over the NIS protocol by using the NIS plug-in.
- to an LDAP format that is compliant with RFC 2307 or RFC 2307bis.
21.1.1.1. Displaying NIS Netgroup Entries
memberUser attribute, and hosts and host groups in memberHost. The following example shows a netgroup entry in Directory Server component of IdM:
Example 21.1. A NIS Entry in Directory Server
dn: ipaUniqueID=d4453480-cc53-11dd-ad8b-0800200c9a66,cn=ng,cn=alt,... ... cn: netgroup1 memberHost: fqdn=host1.example.com,cn=computers,cn=accounts,... memberHost: cn=VirtGuests,cn=hostgroups,cn=accounts,... memberUser: cn=demo,cn=users,cn=accounts,... memberUser: cn=Engineering,cn=groups,cn=accounts,... nisDomainName: nisdomain.example.com
ipa netgroup-* commands. For example, to display a netgroup entry:
Example 21.2. Displaying a Netgroup Entry
[root@server ~]# ipa netgroup-show netgroup1 Netgroup name: netgroup1 Description: my netgroup NIS domain name: nisdomain.example.com Member Host: VirtGuests Member Host: host1.example.com Member User: demo Member User: Engineering
21.2. Enabling NIS in Identity Management
- Enable the NIS listener and compatibility plug-ins:
[root@ipaserver ~]# ipa-nis-manage enable [root@ipaserver ~]# ipa-compat-manage enable
- Optional: Set a fixed port for the NIS remote procedure calls (RPC).When using NIS, the client must know to which port on the IdM server to use to establish the connection. Using the default settings, IdM binds to an unused random port when the server starts. This port is sent to the port mapper service the client uses to request the port number.For a more strict firewall configuration, you can set a fixed port. For example, to set the port to
514:[root@ipaserver ~]# ldapmodify -x -D 'cn=directory manager' -W dn: cn=NIS Server,cn=plugins,cn=config changetype: modify add: nsslapd-pluginarg0 nsslapd-pluginarg0: 514
Note
You can set any unused port number below 1024 for the setting. - Enable and start the port mapper service:
[root@ipaserver ~]# systemctl enable rpcbind.service [root@ipaserver ~]# systemctl start rpcbind.service
- Restart Directory Server:
[root@ipaserver ~]# systemctl restart dirsrv.target
21.3. Creating Netgroups
21.3.1. Adding a Netgroup
- the IdM web UI (see the section called “Web UI: Adding a Netgroup”)
- the command line (see the section called “Command Line: Adding a Netgroup”)
Web UI: Adding a Netgroup
- Select → →
- Click Add.
- Enter a unique name and, optionally, a description. The group name is the identifier used for the netgroup in the IdM domain. You cannot change it later.
- Click to save the changes and to start editing the entry.
- The default NIS domain is set to the IdM domain name. Optionally, you can enter the name of the alternative NIS domain in the NIS domain name field.

Figure 21.1. Netgroup Tab
The NIS domain name field sets the domain that appears in the netgroup triple. It does not affect which NIS domain the Identity Management NIS listener responds to. - Add members, as described in the section called “Web UI: Adding Members to a Netgroup”.
- Click .
Command Line: Adding a Netgroup
ipa netgroup-add command. Specify:
- the group name.
- optionally, a description.
- optionally, the NIS domain name if it is different than the IdM domain name.
Note
The--nisdomainoption sets the domain that appears in the netgroup triple. It does not affect which NIS domain the Identity Management listener responds to.
[root@server ~]# ipa netgroup-add --desc="Netgroup description" --nisdomain="example.com" example-netgroup
21.3.2. Adding Members to a Netgroup
- the IdM web UI (see the section called “Web UI: Adding Members to a Netgroup”)
- the command line (see the section called “Command Line: Adding Members to a Netgroup”)
Warning
Web UI: Adding Members to a Netgroup
- Select → →
- Click the name of the netgroup to which to add members.
- Click next to the required member type.
- Select the members you want to add, and click to confirm.

Figure 21.3. Add User Menu in the Netgroup Tab
- Click .
Command Line: Adding Members to a Netgroup
ipa netgroup-add-member command:
# ipa netgroup-add-member --users=user_name --groups=group_name --hosts=host_name \
--hostgroups=host_group_name --netgroups=netgroup_name group_nameame[root@server ~]# ipa netgroup-add-member --users={user1;user2,user3} \
--groups={group1,group2} example-group21.4. Exposing Automount Maps to NIS Clients
- the name of the NIS domain
- the name of the NIS map
- information on how to find the directory entries to use as the NIS map's contents
- information on which attributes to use as the NIS map's key and value
21.4.1. Adding an Automount Map
cn=automount branch of the IdM directory tree. You can add the NIS domain and maps using the LDAP protocol.
auto.example in the default location for the example.com domain:
[root@server ~]# ldapadd -h server.example.com -x -D "cn=Directory Manager" -W
dn: nis-domain=example.com+nis-map=auto.example,cn=NIS Server,cn=plugins,cn=config
objectClass: extensibleObject
nis-domain: example.com
nis-map: auto.example
nis-filter: (objectclass=automount)
nis-key-format: %{automountKey}
nis-value-format: %{automountInformation}
nis-base: automountmapname=auto.example,cn=default,cn=automount,dc=example,dc=comNote
nis-domain attribute to the name of your NIS domain.
nis-base attribute must correspond:
- To an existing automount map set using the
ipa automountmap-*commands. - To an existing automount location set using the
ipa automountlocation-*commands.
[root@server ~]# ypcat -k -d example.com -h server.example.com auto.example
21.5. Migrating from NIS to IdM
21.5.1. Preparing Netgroup Entries in IdM
- User Entries
- Determine what applications are using the user information provided by NIS. While some utilities, such as
sudo, require NIS netgroups, several others can use regular UNIX groups.To migrate:- Create the corresponding user accounts in IdM. See Section 21.5.3.1, “Migrating User Entries”.
- If you additionally require netgroups:
- Add the netgroups. See Section 21.3.1, “Adding a Netgroup”.
- Add the users to the netgroups. See Section 21.5.3.4, “Migrating Netgroup Entries”.
- Host Entries
- When you create a host group in IdM, a corresponding shadow NIS group is automatically created. Do not use the
ipa netgroup-*commands on these shadow NIS groups. Use theipa netgroup-*commands only to manage native netgroups created via thenetgroup-addcommand. - For a Direct Conversion
- If every user and host entry must use the same name, you can create the entries using the same names in IdM:
- Create an entry for every user referenced in a netgroup.
- Create an entry for every host referenced in a netgroup.
- Create a netgroup with the same name as the original netgroup.
- Add the users and hosts as direct members of the netgroup. If the users and hosts are members of groups or host groups, you can alternatively add these groups to the netgroup.
21.5.2. Enabling the NIS Listener in Identity Management
21.5.3. Exporting and Importing the Existing NIS Data
ypcat command, and use the output to import the entries to IdM using the corresponding ipa *-add commands.
21.5.3.1. Migrating User Entries
passwd map contains information about users, such as names, UIDs, primary group, GECOS, shell, and home directory. Use this data to migrate NIS user accounts to IdM:
- Optional: If you require weak password support, see Section 21.5.4, “Enabling Weak Password Hashing for NIS User Authentication”.
- Create the
/root/nis-users.shscript with the following content:#!/bin/sh # $1 is the NIS domain, $2 is the NIS master server ypcat -d $1 -h $2 passwd > /dev/shm/nis-map.passwd 2>&1 IFS=$'\n' for line in $(cat /dev/shm/nis-map.passwd) ; do IFS=' ' username=$(echo $line | cut -f1 -d:) # Not collecting encrypted password because we need cleartext password # to create kerberos key uid=$(echo $line | cut -f3 -d:) gid=$(echo $line | cut -f4 -d:) gecos=$(echo $line | cut -f5 -d:) homedir=$(echo $line | cut -f6 -d:) shell=$(echo $line | cut -f7 -d:) # Now create this entry echo passw0rd1 | ipa user-add $username --first=NIS --last=USER \ --password --gidnumber=$gid --uid=$uid --gecos=$gecos --homedir=$homedir \ --shell=$shell ipa user-show $username done
- Authenticate as the IdM
adminuser:[root@nis-server ~]# kinit admin
- Run the script. For example:
[root@nis-server ~]# sh /root/nis-users.sh nisdomain nis-master.example.com
Note
This script uses hard-coded values for first name, last name, and sets the password topassw0rd1. The user must change the temporary password at the next log in.
21.5.3.2. Migrating Group Entries
group map contains information about groups, such as group names, GIDs, or group members. Use this data to migrate NIS groups to IdM:
- Create the
/root/nis-groups.shscript with the following content:#!/bin/sh # $1 is the NIS domain, $2 is the NIS master server ypcat -d $1 -h $2 group > /dev/shm/nis-map.group 2>&1 IFS=$'\n' for line in $(cat /dev/shm/nis-map.group); do IFS=' ' groupname=$(echo $line | cut -f1 -d:) # Not collecting encrypted password because we need cleartext password # to create kerberos key gid=$(echo $line | cut -f3 -d:) members=$(echo $line | cut -f4 -d:) # Now create this entry ipa group-add $groupname --desc=NIS_GROUP_$groupname --gid=$gid if [ -n "$members" ]; then ipa group-add-member $groupname --users={$members} fi ipa group-show $groupname done - Authenticate as the IdM
adminuser:[root@nis-server ~]# kinit admin
- Run the script. For example:
[root@nis-server ~]# sh /root/nis-groups.sh nisdomain nis-master.example.com
21.5.3.3. Migrating Host Entries
hosts map contains information about hosts, such as host names and IP addresses. Use this data to migrate NIS host entries to IdM:
- Create the
/root/nis-hosts.shscript with the following content:#!/bin/sh # $1 is the NIS domain, $2 is the NIS master server ypcat -d $1 -h $2 hosts | egrep -v "localhost|127.0.0.1" > /dev/shm/nis-map.hosts 2>&1 IFS=$'\n' for line in $(cat /dev/shm/nis-map.hosts); do IFS=' ' ipaddress=$(echo $line | awk '{print $1}') hostname=$(echo $line | awk '{print $2}') master=$(ipa env xmlrpc_uri | tr -d '[:space:]' | cut -f3 -d: | cut -f3 -d/) domain=$(ipa env domain | tr -d '[:space:]' | cut -f2 -d:) if [ $(echo $hostname | grep "\." |wc -l) -eq 0 ] ; then hostname=$(echo $hostname.$domain) fi zone=$(echo $hostname | cut -f2- -d.) if [ $(ipa dnszone-show $zone 2>/dev/null | wc -l) -eq 0 ] ; then ipa dnszone-add --name-server=$master --admin-email=root.$master fi ptrzone=$(echo $ipaddress | awk -F. '{print $3 "." $2 "." $1 ".in-addr.arpa."}') if [ $(ipa dnszone-show $ptrzone 2>/dev/null | wc -l) -eq 0 ] ; then ipa dnszone-add $ptrzone --name-server=$master --admin-email=root.$master fi # Now create this entry ipa host-add $hostname --ip-address=$ipaddress ipa host-show $hostname done - Authenticate as the IdM
adminuser:[root@nis-server ~]# kinit admin
- Run the script. For example:
[root@nis-server ~]# sh /root/nis-hosts.sh nisdomain nis-master.example.com
Note
This script does not migrate special host configurations, such as aliases.
21.5.3.4. Migrating Netgroup Entries
netgroup map contains information about netgroups. Use this data to migrate NIS netgroups to IdM:
- Create the
/root/nis-netgroups.shscript with the following content:#!/bin/sh # $1 is the NIS domain, $2 is the NIS master server ypcat -k -d $1 -h $2 netgroup > /dev/shm/nis-map.netgroup 2>&1 IFS=$'\n' for line in $(cat /dev/shm/nis-map.netgroup); do IFS=' ' netgroupname=$(echo $line | awk '{print $1}') triples=$(echo $line | sed "s/^$netgroupname //") echo "ipa netgroup-add $netgroupname --desc=NIS_NG_$netgroupname" if [ $(echo $line | grep "(," | wc -l) -gt 0 ]; then echo "ipa netgroup-mod $netgroupname --hostcat=all" fi if [ $(echo $line | grep ",," | wc -l) -gt 0 ]; then echo "ipa netgroup-mod $netgroupname --usercat=all" fi for triple in $triples; do triple=$(echo $triple | sed -e 's/-//g' -e 's/(//' -e 's/)//') if [ $(echo $triple | grep ",.*," | wc -l) -gt 0 ]; then hostname=$(echo $triple | cut -f1 -d,) username=$(echo $triple | cut -f2 -d,) domain=$(echo $triple | cut -f3 -d,) hosts=""; users=""; doms=""; [ -n "$hostname" ] && hosts="--hosts=$hostname" [ -n "$username" ] && users="--users=$username" [ -n "$domain" ] && doms="--nisdomain=$domain" echo "ipa netgroup-add-member $hosts $users $doms" else netgroup=$triple echo "ipa netgroup-add $netgroup --desc=NIS_NG_$netgroup" fi done done - Authenticate as the IdM
adminuser:[root@nis-server ~]# kinit admin
- Run the script. For example:
[root@nis-server ~]# sh /root/nis-netgroups.sh nisdomain nis-master.example.com
21.5.3.5. Migrating Automount Maps
- Create the
/root/nis-automounts.shscript with the following content:#!/bin/sh # $1 is for the automount entry in ipa ipa automountlocation-add $1 # $2 is the NIS domain, $3 is the NIS master server, $4 is the map name ypcat -k -d $2 -h $3 $4 > /dev/shm/nis-map.$4 2>&1 ipa automountmap-add $1 $4 basedn=$(ipa env basedn | tr -d '[:space:]' | cut -f2 -d:) cat > /tmp/amap.ldif <<EOF dn: nis-domain=$2+nis-map=$4,cn=NIS Server,cn=plugins,cn=config objectClass: extensibleObject nis-domain: $2 nis-map: $4 nis-base: automountmapname=$4,cn=$1,cn=automount,$basedn nis-filter: (objectclass=*) nis-key-format: %{automountKey} nis-value-format: %{automountInformation} EOF ldapadd -x -h $3 -D "cn=Directory Manager" -W -f /tmp/amap.ldif IFS=$'\n' for line in $(cat /dev/shm/nis-map.$4); do IFS=" " key=$(echo "$line" | awk '{print $1}') info=$(echo "$line" | sed -e "s#^$key[ \t]*##") ipa automountkey-add nis $4 --key="$key" --info="$info" doneThe script exports the NIS automount information, generates an LDAP Data Interchange Format (LDIF) for the automount location and associated map, and imports the LDIF file into the IdM Directory Server. For further details, see Section 21.4, “Exposing Automount Maps to NIS Clients”. - Authenticate as the IdM
adminuser:[root@nis-server ~]# kinit admin
- Run the script. For example:
[root@nis-server ~]# sh /root/nis-automounts.sh location nisdomain \ nis-master.example.com map_name
21.5.4. Enabling Weak Password Hashing for NIS User Authentication
userPassword attribute are hashed using the salted secure hash algorithm (SSHA). If your NIS clients require a weak hashing algorithm for passwords, update the password storage scheme setting.
userPassword attribute. Note that Kerberos does not use this attribute and therefore Kerberos encryption is not affected by this setting.
CRYPT hashed passwords:
[root@server ~]# ldapmodify -D "cn=Directory Manager" -W -p 389 -h ipaserver.example.com -x dn: cn=config changetype: modify replace: passwordStorageScheme passwordStorageScheme: crypt
Note
Part V. Administration: Managing Authentication
Chapter 22. User Authentication
Note
22.1. User Passwords
22.1.1. Changing and Resetting User Passwords
- Must meet the IdM password policies. For details on configuring password policies, see Chapter 28, Defining Password Policies.
- Do not have to meet the IdM password policies
- Expire after the first successful login. When this happens, IdM prompts the user to change the expired password immediately. To disable this behavior, see Section 22.1.2, “Enabling Password Reset Without Prompting for a Password Change at the Next Login”.
Note
22.1.1.1. Web UI: Changing Your Own Personal Password
- In the top right corner, click → .

Figure 22.1. Resetting Password
- Enter the new password.
22.1.1.2. Web UI: Resetting Another User's Password
- Select → .
- Click the name of the user to edit.
- Click → .

Figure 22.2. Resetting Password
- Enter the new password, and click .

Figure 22.3. Confirming New Password
22.1.1.3. Command Line: Changing or Resetting Another User's Password
--password option to the ipa user-mod command. The command will prompt you for the new password.
$ ipa user-mod user --password Password: Enter Password again to verify: -------------------- Modified user "user" -------------------- ...
22.1.2. Enabling Password Reset Without Prompting for a Password Change at the Next Login
- Edit the password synchronization entry:
cn=ipa_pwd_extop,cn=plugins,cn=config. - Specify the administrative user accounts in the
passSyncManagersDNsattribute. The attribute is multi-valued.
admin user by using the ldapmodify utility:
$ ldapmodify -x -D "cn=Directory Manager" -W -h ldap.example.com -p 389
dn: cn=ipa_pwd_extop,cn=plugins,cn=config
changetype: modify
add: passSyncManagersDNs
passSyncManagersDNs: uid=admin,cn=users,cn=accounts,dc=example,dc=comWarning
passSyncManagerDNs can:
- Perform password change operations without requiring a subsequent password reset
- Bypass the password policy so that no strength or history enforcement is applied
22.1.3. Unlocking User Accounts After Password Failures
Note
Unlocking a User Account Manually
ipa user-unlock command.
$ ipa user-unlock user ----------------------- Unlocked account "user" -----------------------
22.1.3.1. Checking the Status of a User Account
ipa user-status command. If the displayed number exceeds the number of allowed failed login attempts, the user account is locked.
$ ipa user-status user
-----------------------
Account disabled: False
-----------------------
Server: example.com
Failed logins: 8
Last successful authentication: 20160229080309Z
Last failed authentication: 20160229080317Z
Time now: 2016-02-29T08:04:46Z
----------------------------
Number of entries returned 1
----------------------------
22.2. One-Time Passwords
Important
- The user authenticates with a traditional password.
- The user provides an OTP code generated by a recognized OTP token.
Warning
- The most important security limitation is the potential vulnerability to replay attacks across the system. Replication is asynchronous, and an OTP code can therefore be reused during the replication period. A user might be able to log on to two servers at the same time. However, this vulnerability is usually difficult to exploit due to comprehensive encryption.
- It is not possible to obtain a ticket-granting ticket (TGT) using a client that does not support OTP authentication. This might affect certain use cases, such as authentication using the
mod_auth_kerbmodule or the Generic Security Services API (GSSAPI). - It is not possible to use password + OTP in the IdM solution if the FIPS mode is enabled.
22.2.1. How OTP Authentication Works in IdM
22.2.1.1. OTP Tokens Supported in IdM
Software and Hardware Tokens
User-managed and Administrator-managed Tokens
- User-managed tokens
- Users have full control over user-managed tokens in Identity Management: they are allowed to create, edit, or delete their tokens.
- Administrator-managed tokens
- The administrator adds administrator-managed tokens to the users' accounts. Users themselves have read-only access for such tokens: they do not have the permission to manage or modify the tokens and they are not required to configure them in any way.
Supported OTP Algorithms
- The HMAC-Based One-Time Password (HOTP) algorithm is based on a counter. HMAC stands for Hashed Message Authentication Code.
- The Time-Based One-Time Password (TOTP) algorithm is an extension of HOTP to support time-based moving factor.
22.2.1.2. Available OTP Authentication Methods
- Two-factor authentication (password + OTP)
- With this method, the user is always required to enter both a standard password and an OTP code.
- Password
- With this method, the user still has the option to authenticate using a standard password only.
- RADIUS proxy server authentication
- For information on configuring a RADIUS server for OTP validation, see Section 22.2.6, “Migrating from a Proprietary OTP Solution”.
Global and User-specific Authentication Methods
- By default, user-specific authentication method settings take precedence over global settings. If no authentication method is set for a user, the globally-defined methods apply.
- You can disable per-user authentication method settings for any user. This ensures IdM ignores the per-user settings and always applies the global settings for the user.
Combining Multiple Authentication Methods
- If you configure both two-factor and password authentication, the user must provide the password (first factor), but providing the OTP (second factor) is optional when using the command line:
First Factor: Second Factor (optional):
- In the web UI, the user must still provide both factors.
Note
- Kerberos will always use RADIUS, but LDAP will not. LDAP only recognizes the password and two-factor authentication methods.
- If you use an external two-factor authentication provider, use Kerberos from your applications. If you want to let users authenticate with a password only, use LDAP. It is recommended that the applications leverage Apache modules and SSSD, which allows to configure either Kerberos or LDAP.
22.2.1.3. GNOME Keyring Service Support
First factor: static_password Second factor: one-time_password
22.2.1.4. Offline Authentication with OTP
First factor: static_password Second factor: one-time_password
First factor prompt. However, note that this is not compatible with offline OTP authentication. If the user enters both factors in a single prompt, IdM will always have to contact the central authentication server when authenticating, which requires the system to be online.
Important
- The
cache_credentialsoption in the/etc/sssd/sssd.conffile is set toTrue, which enables caching the first factor password. - The first-factor static password meets the password length requirement defined in the
cache_credentials_minimal_first_factor_lengthoption set in/etc/sssd/sssd.conf. The default minimal length is 8 characters. For more information about the option, see the sssd.conf(5) man page.
krb5_store_password_if_offline option is set to true in /etc/sssd/sssd.conf, SSSD does not attempt to refresh the Kerberos ticket-granting ticket (TGT) when the system goes online again because the OTP might already be invalid at that point. To obtain a TGT in this situation, the user must authenticate again using both factors.
22.2.2. Enabling OTP Authentication
- the web UI, see the section called “Web UI: Enabling OTP Authentication”.
- the command line, see the section called “Command Line: Enabling OTP Authentication”.
Web UI: Enabling OTP Authentication
- Select → .
- In the User Options area, select the required Default user authentication types.

Figure 22.4. User Authentication Methods
- Select → , and click the name of the user to edit.
- In the Account Settings area, select the required User authentication types.

Figure 22.5. User Authentication Methods
Command Line: Enabling OTP Authentication
- Run the
ipa config-mod --user-auth-typecommand. For example, to set the global authentication method to two-factor authentication:$ ipa config-mod --user-auth-type=otp
For a list of values accepted by--user-auth-type, run theipa config-mod --helpcommand. - To disable per-user overrides, thus ensuring the global settings are not overridden with per-user settings, add the
--user-auth-type=disabledoption as well. For example, to set the global authentication method to two-factor authentication and disable per-user overrides:$ ipa config-mod --user-auth-type=otp --user-auth-type=disabled
If you do not set--user-auth-type=disabled, authentication methods configured per user take precedence over the global settings.
- Run the
ipa user-mod --user-auth-typecommand. For example, to set thatuserwill be required to use two-factor authentication:$ ipa user-mod user --user-auth-type=otp
--user-auth-type multiple times. For example, to configure both password and two-factor authentication globally for all users:
$ ipa config-mod --user-auth-type=otp --user-auth-type=password
22.2.3. Adding a User-Managed Software Token
- Log in with your standard password.
- Make sure the
FreeOTP Authenticatorapplication is installed on your mobile device. To downloadFreeOTP Authenticator, see the FreeOTP source page. - Create the software token in the IdM web UI or from the command line.
- To create the token in the web UI, click Add under the OTP tokens tab. If you are logged-in as the administrator, the OTP Tokens tab is accessible through the Authentication tab.

Figure 22.6. Adding an OTP Token for a User
- To create the token from the command line, run the
ipa otptoken-addcommand.$ ipa otptoken-add ------------------ Added OTP token "" ------------------ Unique ID: 7060091b-4e40-47fd-8354-cb32fecd548a Type: TOTP ...
For more information aboutipa otptoken-add, run the command with the--helpoption added.
- A QR code is displayed in the web UI or on the command line. Scan the QR code with
FreeOTP Authenticatorto provision the token to the mobile device.
22.2.4. Adding a User-Managed YubiKey Hardware Token
- Log in with your standard password.
- Insert your YubiKey token.
- Run the
ipa otptoken-add-yubikeycommand.- If the YubiKey has an empty slot available, the command will select the empty slot automatically.
- If no empty slot is available, you must select a slot manually using the
--slotoption.For example:$ ipa otptoken-add-yubikey --slot=2
Note that this overwrites the selected slot.
22.2.5. Adding a Token for a User as the Administrator
- Make sure you are logged-in as the administrator.
- Make sure the
FreeOTP Authenticatorapplication is installed on the mobile device. To downloadFreeOTP Authenticator, see the FreeOTP source page. - Create the software token in the IdM web UI or from the command line.
- To create the token in the web UI, select → and click at the top of the list of OTP tokens. In the Add OTP Token form, select the owner of the token.

Figure 22.7. Adding an Administrator-Managed Software Token
- To create the token from the command line, run the
ipa otptoken-addcommand with the--owneroption. For example:$ ipa otptoken-add --owner=user ------------------ Added OTP token "" ------------------ Unique ID: 5303baa8-08f9-464e-a74d-3b38de1c041d Type: TOTP ...
- A QR code is displayed in the web UI or on the command line. Scan the QR code with
FreeOTP Authenticatorto provision the token to the mobile device.
- Make sure you are logged-in as the administrator.
- Insert the YubiKey token.
- Run the
ipa otptoken-add-yubikeycommand with the--owneroption. For example:$ ipa otptoken-add-yubikey --owner=user
22.2.6. Migrating from a Proprietary OTP Solution
Note
- Make sure that the radius user authentication method is enabled. See Section 22.2.2, “Enabling OTP Authentication”.
- Run the
ipa radiusproxy-add proxy_namecommand to add a RADIUS proxy. The command prompts you for the required information. - Run the
ipa user-mod radiususer --radius=proxy_namecommand to assign a user to the added proxy. - If required, configure the user name to be sent to RADIUS by running the
ipa user-mod radiususer --radius-username=radius_usercommand.
22.2.7. Promoting the Current Credentials to Two-Factor Authentication
- Lock your screen. The default keyboard shortcut to lock the screen is Super key+L.
- Unlock your screen. When asked for credentials, use both password and OTP.
22.2.8. Resynchronizing an OTP Token
22.3. Restricting Access to Services and Hosts Based on How Users Authenticate
- services critical to security, such as VPN, to require a strong authentication method
- noncritical services, such as local logins, to allow authentication using a weaker, but more convenient authentication method

Figure 22.8. Example of Authenticating Using Different Methods
Authentication Indicators
- Indicators included in a service or host entry define what authentication methods the user can use to access that service or host.
- Indicators included in the user's ticket-granting ticket (TGT) show what authentication method was used to obtain the ticket.
22.3.1. Configuring a Host or a Service to Require a Specific Authentication Method
Web UI: Configuring a Host or a Service to Require a Specific Authentication Method
- Select → or → .
- Click the name of the required host or service.
- Under Authentication indicators, select the required authentication method.
- For example, selecting OTP ensures that only users who used a valid OTP code with their password will be allowed to access the host or service.
- If you select both OTP and RADIUS, either OTP or RADIUS will be sufficient to allow access.
- Click at the top of the page.
Command Line: Configuring a Host or a Service to Require a Specific Authentication Method
- Optional. Use the
ipa host-findoripa service-findcommands to identify the host or service. - Use the
ipa host-modor theipa service-modcommand with the--auth-indoption to add the required authentication indicator. For a list of the values accepted by--auth-ind, see the output of theipa host-mod --helporipa service-mod --helpcommands.For example,--auth-ind=otpensures that only users who used a valid OTP code with their password will be allowed to access the host or service:$ ipa host-mod server.example.com --auth-ind=otp --------------------------------------------------------- Modified host "server.example.com" --------------------------------------------------------- Host name: server.example.com ... Authentication Indicators: otp ...
If you add indicators for both OTP and RADIUS, either OTP or RADIUS will be sufficient to allow access.
22.4. Managing Public SSH Keys for Users
ssh to log into an IdM machine without using Kerberos credentials. If pam_krb5 is configured properly or if SSSD is used as the IdM server's identity provider, the user also receives a Kerberos ticket-granting ticket (TGT) after login; see the section called “Obtaining Kerberos Tickets Automatically” for more details.
Caching and Retrieving SSH Keys Automatically
SSH Key Format Requirements
id_rsa.pub, consists of three parts: the key type, the key itself, and an additional comment or identifier. In the following example, the key type is RSA and the comment associates the key with the client.example.com host name:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMM4xPu54Kf2dx7C4Ta2F7vnIzuL1i6P21TTKniSkjFuA+r qW06588e7v14Im4VejwnNk352gp49A62qSVOzp8IKA9xdtyRmHYCTUvmkcyspZvFRI713zfRKQVFyJOqHmW/m dCmak7QBxYou2ELSPhH3pe8MYTQIulKDSu5Zbsrqedg1VGkSJxf7mDnCSPNWWzAY9AFB9Lmd2m2xZmNgVAQEQ nZXNMaIlroLD/51rmMSkJGHGb1O68kEq9Z client.example.com
22.4.1. Generating an SSH Key
ssh-keygen utility. The utility displays information about the location of the public key. For example:
$ ssh-keygen -t rsa -C user@example.com
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Created directory '/home/user/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:GAUIDVVEgly7rs1lTWP6oguHz8BKvyZkpqCqVSsmi7c user@example.com
The key's randomart image is:
+--[ RSA 2048]----+
| |
| + . |
| + = . |
| = + |
| . E S.. |
| . . .o |
| . . . oo. |
| . o . +.+o |
| o .o..o+o |
+-----------------+
22.4.2. Uploading User SSH Keys
22.4.2.1. Web UI: Uploading User SSH Keys
- Select → .
- Click the name of the user to edit.
- Under the Settings tab in the Account Settings area, click SSH public keys: Add.

Figure 22.9. SSH public keys in the Account Settings
- Paste in the Base 64-encoded public key string, and click .

Figure 22.10. Pasting in the Public Key
- Click Save at the top of the page.
22.4.2.2. Command Line: Uploading User SSH Keys
ipa user-mod command and pass the Base 64-encoded public key string using the --sshpubkey option.
$ ipa user-mod user --sshpubkey="ssh-rsa AAAAB3Nza...SNc5dv== client.example.com"
--sshpubkey multiple times. For example, to upload two SSH keys:
--sshpubkey="AAAAB3Nza...SNc5dv==" --sshpubkey="RjlzYQo...ZEt0TAo="
Note
$ ipa user-mod user --sshpubkey="$(cat ~/.ssh/id_rsa.pub)" --sshpubkey="$(cat ~/.ssh/id_rsa2.pub)"
22.4.3. Deleting User Keys
- using the web UI, see Section 22.4.3.1, “Web UI: Deleting User SSH Keys”
- using the command line, see Section 22.4.3.2, “Command Line: Deleting User SSH Keys”
22.4.3.1. Web UI: Deleting User SSH Keys
- Select → .
- Click the name of the user to edit.
- Under the Settings tab in the Account Settings area, click Delete next to the key you want to remove.

Figure 22.11. Deleting User SSH Public Key
- Click Save at the top of the page.
22.4.3.2. Command Line: Deleting User SSH Keys
--sshpubkey option to the ipa user-mod command without specifying any key:
$ ipa user-mod user --sshpubkey=
--sshpubkey option to specify the key or keys you want to keep.
22.5. Configuring SSSD to Provide a Cache for the OpenSSH Services
22.5.1. How SSSD Works with OpenSSH
- OpenSSH is configured to reference SSSD to check for cached keys.
- SSSD uses an Identity Management (IdM) domain, and IdM stores the public keys and host information.
Note
How SSSD Manages Host Keys
- Retrieves the public host key from the host system.
- Stores the host key in the
/var/lib/sss/pubconf/known_hostsfile. - Establishes a connection with the host machine.
How SSSD Manages User Keys
- Retrieves the user's public key from the user entries in the IdM domain.
- Stores the user key in the
.ssh/sss_authorized_keysfile in the standard authorized keys format.
22.5.2. Configuring OpenSSH to Use SSSD for Host Keys
- Open the required configuration file.
- To change user-specific configuration, open the
~/.ssh/configfile. - To change system-wide configuration, open the
/etc/ssh/sshd_configfile.
- Use the
ProxyCommandoption to specify what command will be used to connect to the SSH client (thesss_ssh_knownhostsproxyutility with the required arguments and host name).For details onsss_ssh_knownhostsproxy, see the sss_ssh_knownhostsproxy(1) man page. - Use the
GlobalKnownHostsFileoption to specify the location of the SSSD hosts file:/var/lib/sss/pubconf/known_hosts. This file will be used instead of the default OpenSSHknown_hostsfile.
ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h GlobalKnownHostsFile /var/lib/sss/pubconf/known_hosts
22.5.3. Configuring OpenSSH to Use SSSD for User Keys
- Open the required configuration file.
- To change user-specific configuration, open the
~/.ssh/configfile. - To change system-wide configuration, open the
/etc/ssh/sshd_configfile.
- Use the
AuthorizedKeysCommandoption to specify the command that will be executed to retrieve user keys. - Use the
AuthorizedKeysCommandUseroption to specify the user under whose account the command will be run.
sss_ssh_authorizedkeys utility under the account of user.
AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys AuthorizedKeysCommandUser user
sss_ssh_authorizedkeys, see the sss_ssh_authorizedkeys(1) man page.
22.6. Smart-card Authentication in Identity Management
22.7. User Certificates
Chapter 23. Smart-card Authentication in Identity Management
23.1. Managing Smart Card Links in the Identity Management Server
- If you need to extract the certificate from the smart card, see Section 23.1.1, “Exporting a Certificate From a Smart Card”.
23.1.1. Exporting a Certificate From a Smart Card
- Place the smart card into the reader.
- Use the following command to list the certificates on the smart card. In the output, locate the certificate to use for authentication, and note its nickname:
$
certutil -L -d /etc/pki/nssdb/ -h allCertificate Nickname Trust Attributes SSL,S/MIME,JAR/XPI my_certificate CT,C,C - Extract the certificate to a file using the certificate nickname. For example, to extract the certificate in the Base64 format to a file named
user.crt:$
certutil -L -d /etc/pki/nssdb/ -n 'my_certificate' -r | base64 -w 0 > user.crtThebase64utility is part of the coreutils package.
23.1.2. Linking User Accounts to Smart Card Certificates
- Using the full certificate blob:
- For Identity Management users, see Section 23.1.2.1, “Creating a Link Between a Certificate and a User Account”. You can also remove such link using Section 23.1.2.2, “Removing a Link Between a Certificate and a User Account”.
- For Active Directory users, see Section 23.1.2.3, “Linking an Active Directory User Account and a Smart Card”.
- Using certificate mapping: Section 23.1.2.4, “Configuring Identity Mapping”
23.1.2.1. Creating a Link Between a Certificate and a User Account
Command Line: Creating a Link Between a Certificate and a User Account
- Log in as the Identity Management administrator:
$
kinit admin - Add the smart card certificate to the user account using the
ipa user-add-certcommand. For example:$
cat cert.pem | tail -n +2 | head -n -1 | tr -d '\r\n' | ipa user-add-cert idm_user
Web UI: Creating a Link Between a Certificate and a User Account
- Select → , and click on the required user account.
- Click next to the Certificates entry, and enter the certificate.
- Click at the top of the user account page.
Additional Resources
- For details on adding and removing certificates issued by an external certificate authority (CA), see Section 24.2, “Managing Certificates Issued by External CAs”.
23.1.2.2. Removing a Link Between a Certificate and a User Account
Command Line: Creating a Link Between a Certificate and a User Account
- Log in as the Identity Management administrator:
$
kinit admin - Find the required user account:
$
ipa user-show idm_userUser login: idm_user First name: first_name Last name: last_name ... Certificate: MIIC3... - Remove the certificate from the account:
$
ipa user-remove-cert idm_user --certificate MIIC3...
Web UI: Removing a Link Between a Certificate and a User Account
- Select → , and click on the required user account.
- Click next to the certificate to delete, and select .
Additional Resources
23.1.2.3. Linking an Active Directory User Account and a Smart Card
Command Line: Linking an Active Directory User Account and a Smart Card
- Log in as the Identity Management administrator:
$
kinit admin - Create an environment variable (
CERT) for the user certificate:$
CERT=`cat cert.pem | tail -n +2 | head -n -1 | tr -d '\r\n'` - Add the user certificate to the ID view by creating a new ID override. In this procedure, we are using the Default Trust View:
$
ipa idoverrideuser-add 'Default Trust View' ad_user@ad.example.com --certificate $CERT
Web UI: Linking an Active Directory User Account and a Smart Card
- Select → , and click on the required ID view.
- Add the user certificate to the ID view by creating a new ID override. Click , and fill out the required information in the Add User ID override form.
Additional Resources
- For details on managing ID views, see Chapter 18, ID Views.
- For details on the Default Trust View, see Using ID Views in Active Directory Environments.
23.1.2.4. Configuring Identity Mapping
23.1.2.4.1. Identity Mapping in Identity Management
- Mapping rule
- A mapping rule associates (or maps) a certificate with one or more user accounts. The rule defines an LDAP search filter that associates a certificate with the intended user account.Certificates issued by different certificate authorities (CAs) might have different properties and might be used in different domains. Therefore, Identity Management does not apply mapping rules unconditionally, but only to the appropriate certificates. The appropriate certificates are defined using matching rules.
- Matching rule
- A matching rule selects a certificate or CA to which you want to apply the mapping rule.
- Domain list
- The domain list specifies the DNS domain names in which you want Identity Management to search the users when processing identity mapping rules.
Note
If you do not specify any domains, Identity Management searches the users only in the local domain to which the client belongs. - Priority
- When multiple rules are applicable to a certificate, the rule with the highest priority takes precedence. All other rules are ignored.
- The lower the numerical value, the higher the priority of the identity mapping rule. For example, a rule with a priority 1 has higher priority than a rule with a priority 2.
- If a rule has no priority value defined, it has the lowest priority.
23.1.2.4.2. Creating a Certificate Identity Mapping Rule
Command Line: Creating a Certificate Identity Mapping Rule
- Log in as the administrator:
$
kinit admin - Create the rule by using the
ipa certmaprule-addcommand. To specify the components for the identity mapping rule, use these options:--mapruledefines the mapping rule--matchruledefines the matching rule--domaindefines the domain in which you want to search the user entry--prioritydefines the priority of the identity mapping rule
For example, to create a simple identity mapping rule that consists only of a mapping rule and a matching rule:$
ipa certmaprule-add rule_name --matchrule '<ISSUER>CN=Smart Card CA,O=EXAMPLE.ORG' --maprule '(ipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500})'------------------------------------------------------- Added Certificate Identity Mapping Rule "rule_name" ------------------------------------------------------- Rule name: rule_name Mapping rule: (ipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500}) Matching rule: <ISSUER>CN=Smart Card CA,O=EXAMPLE.ORG Enabled: TRUEThis rule now links the subject and issuer from the smart card certificate to the value of theipacertmapdataattribute in the user account.
Web UI: Creating a Certificate Identity Mapping Rule
- Select → .
- Click .
- Fill out the components of the rule, and click .
Additional Resources
- For details on the syntax of the certificate mapping and matching rules, see the sss-certmap(5) man page.
- For details on using the
ipa certmaprule-addcommand, execute it with the--helpoption. - For additional commands for managing identity mapping, use the
ipa help certmapcommand.
23.1.2.4.3. Linking a User Account and a Smart Card Certificate
ipacertmapdata attribute.
Command Line: Linking a User Account and a Smart Card Certificate
- If you have access to the certificate, use the full certificate blob:
$
CERT=`cat cert.pem | tail -n +2| head -n -1 | tr -d '\r\n'`$ipa user-add-certmapdata idm_user --certificate $CERT-------------------------------------------- Added certificate mappings to user "idm_user" -------------------------------------------- User login: idm_user Certificate mapping data: X509:<I>O=EXAMPLE.ORG,CN=Smart Card CA<S>CN=test,O=EXAMPLE.ORG - If you do not have access to the certificate, but know the subject and issuer, use the
--subjectand--issueroptions:$
ipa user-add-certmapdata idm_user --subject "O=EXAMPLE.ORG,CN=test" --issuer "CN=Smart Card CA,O=EXAMPLE.ORG"-------------------------------------------- Added certificate mappings to user "idm_user" -------------------------------------------- User login: idm_user Certificate mapping data: X509:<I>O=EXAMPLE.ORG,CN=Smart Card CA<S>CN=test,O=EXAMPLE.ORG - If you are comfortable with the mapping format, provide the mapping data directly:
$
ipa user-add-certmapdata idm_user 'X509:<I>O=EXAMPLE.ORG,CN=Smart Card CA<S>CN=test,O=EXAMPLE.ORG'-------------------------------------------- Added certificate mappings to user "idm_user" -------------------------------------------- User login: idm_user Certificate mapping data: X509:<I>O=EXAMPLE.ORG,CN=Smart Card CA<S>CN=test,O=EXAMPLE.ORG
Web UI: Linking a User Account and a Smart Card Certificate
- Click → , and click on the required user login.
- Click next to the Certificate mapping data entry.

Figure 23.1. Adding certificate mapping data
- In the Add Certificate Mapping Data form, fill out the required information. Specify one of the following:
- The full certificate blob under Certificate
- The subject and issuer under Issuer and subject
- The mapping data directly under Certificate mapping data
Additional Resources
- For details on the
ipa user-add-certmapdatacommand, execute it with the--helpoption.
23.1.2.4.4. Examples of Identity Mapping Rules
Example 23.1. Active Directory Certificates for Identity Management Users
$ipa certmaprule-add ad_cert_for_ipa_users \--maprule='(ipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500})' \--matchrule='<ISSUER>CN=AD-ROOT-CA,DC=ad,DC=example,DC=com' \--domain=idm.example.com
Example 23.2. Active Directory Certificates for Active Directory Users
$ipa certmaprule-add ad_cert_for_ad_users \--maprule='(altSecurityIdentities=X509:<I>{issuer_dn!ad_x500}<S>{subject_dn!ad_x500})' \--matchrule='<ISSUER>CN=AD-ROOT-CA,DC=ad,DC=example,DC=com' \--domain=ad.example.com
Example 23.3. Active Directory Certificates for Both Identity Management and Active Directory Users
$ipa certmaprule-add ad_cert_for_ipa_and_ad_users \--maprule='(|(ipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500})(altSecurityIdentities=X509:<I>{issuer_dn!ad_x500}<S>{subject_dn!ad_x500}))' \--matchrule='<ISSUER>CN=AD-ROOT-CA,DC=ad,DC=example,DC=com' \--domain=ad.example.com
--maprule option includes these criteria:
ipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500}is a filter that links the subject and issuer from a smart card certificate to the value of theipacertmapdataattribute in an Identity Management user accountaltSecurityIdentities=X509:<I>{issuer_dn!ad_x500}<S>{subject_dn!ad_x500}is a filter that links the subject and issuer from a smart card certificate to the value of thealtSecurityIdentitiesattribute in an Active Directory user account
--maprule option accepts the logical operator | (or), so that you can specify multiple criteria. In this case, the rule maps all user accounts that meet at least one of the criteria.
Example 23.4. Identity Management Certificates for Identity Management and Active Directory Users
$ipa certmaprule-add ipa_cert_for_ad_users \--maprule='(|(userCertificate;binary={cert!bin})(ipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500})(altSecurityIdentities=X509:<I>{issuer_dn!ad_x500}<S>{subject_dn!ad_x500}))' \--matchrule='<ISSUER>CN=Certificate Authority,O=REALM.EXAMPLE.COM' \--domain=idm.example.com --domain=ad.example.com
--maprule option includes these criteria:
userCertificate;binary={cert!bin}is a filter that returns Identity Management or Active Directory user entries that include the whole certificateipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500}is a filter that links the subject and issuer from a smart card certificate to the value of theipacertmapdataattribute in an Identity Management user accountaltSecurityIdentities=X509:<I>{issuer_dn!ad_x500}<S>{subject_dn!ad_x500}is a filter that links the subject and issuer from a smart card certificate to the value of thealtSecurityIdentitiesattribute in an Active Directory user account
--maprule option accepts the logical operator | (or), so that you can specify multiple criteria. In this case, the rule maps all user accounts that meet at least one of the criteria.
23.1.2.4.5. Examples of Translating the Issuer from a Certificate to a Matching Rule
Example 23.5. Translating the Issuer from a Certificate Issued by Identity Management
# openssl x509 -in user.crt -noout -issuer
issuer= /O=REALM.EXAMPLE.COM/CN=Certificate Authority'<ISSUER>CN=Certificate Authority,O=REALM.EXAMPLE.COM'
Example 23.6. Translating the Issuer from a Certificate with an Email Included
# openssl x509 -in expired_user.pem -noout -issuer
issuer= /C=US/ST=North Carolina/L=Raleigh/O=Red Hat/OU=QE/CN=ExampleCA/emailAddress=admin@example.com'<ISSUER>emailAddress=admin@example.com,CN=ExampleCA,OU=QE,O=Red Hat,L=Raleigh,ST=North Carolina,C=US'
23.1.2.5. Additional Resources
- To verify the smart-card certificate links, see Section 23.1.3, “Finding Users That Match a Specified Certificate”.
- For more details on identity mapping for certificates, see Matching and Mapping Certificates in the upstream SSSD documentation.
23.1.3. Finding Users That Match a Specified Certificate
Command Line: Finding Users That Match a Specified Certificate
- Log in as the administrator:
$
kinit admin - To find the user, specify one of the following:
- The name of the certificate file:
$
ipa certmap-match cert.pem-------------- 1 user matched -------------- Domain: IDM.EXAMPLE.COM User logins: idm_user ---------------------------- Number of entries returned 1 ---------------------------- - The contents of the certificate:
$
ipa certmap-match --certificate="MII...."-------------- 1 user matched -------------- Domain: IDM.EXAMPLE.COM User logins: idm_user ---------------------------- Number of entries returned 1 ----------------------------This command returns also users in a trusted Active Directory domain if their user entries contain the full certificate blob:$
ipa certmap-match --certificate="MII...."--------------- 2 users matched --------------- Domain: ad.domain.com User logins: ad_user Domain: IDM.EXAMPLE.COM User logins: idm_user ---------------------------- Number of entries returned 2 ----------------------------
Web UI: Finding Users That Match a Specified Certificate
- Click → → .
- Enter the contents of the certificate in the Certificate field, and click . Identity Management displays the users who match the certificate under Matched Users.

Figure 23.2. List of users who match a certificate
Additional Resources
- For details on the commands for certificate identity mapping, use the
ipa help certmapcommand. - For details on the
ipa certmap-matchcommand, execute it with the--helpoption.
23.1.4. Additional Resources
- For information on managing personal certificates and keys using the Enterprise Security Client, an application for Red Hat Certificate System, see Managing Smart Cards with the Enterprise Security Client in the Certificate System documentation.
23.2. Authenticating to an Identity Management Client with a Smart Card
23.2.1. Smart Card-based Authentication Options Supported on Identity Management Clients
- Local authentication
- Local authentication includes authentication using:
- the text console
- the graphical console, such as the Gnome Display Manager (GDM)
- local authentication services, such as
suorsudo
- Remote authentication with
ssh - Certificates on a smart card are stored together with the PIN-protected SSH private key.
23.2.2. Preparing the Identity Management Client for Smart-card Authentication
- On the server, create a shell script to configure the client.
- Use the
ipa-advise config-client-for-smart-card-authcommand, and save its output to a file:#
ipa-advise config-client-for-smart-card-auth > client_smart_card_script.sh - Open the script file, and review its contents.
- Add execute permissions to the file using the
chmodutility:#
chmod +x client_smart_card_script.sh
- Copy the script to the client, and run it. Add the path to the PEM file with the certificate authority (CA) that signed the smart card certificate:
#
./client_smart_card_script.sh CA_cert.pem
- On the Identity Management server, install the CA certificate:
#
ipa-cacert-manage -n "SmartCard CA" -t CT,C,C install ca.pem#ipa-certupdateRepeatipa-certupdatealso on all replicas and clients. - Restart the HTTP server:
#
systemctl restart httpdRepeatsystemctl restart httpdalso on all replicas.
Note
certificate_verification parameter, for example if the Online Certificate Status Protocol (OCSP) servers defined in the certificate are not reachable from the client. For more information, see the sssd.conf(5) man page.
23.2.3. Authenticating on an Identity Management Client with a Smart Card Using the Console Login
- When logging in from the command line:
client login: idm_user PIN for PIV Card Holder pin (PIV_II) for user idm_user@idm.example.com:
- When logging in using the Gnome Desktop Manager (GDM), GDM prompts you for the smart card PIN after you select the required user:

Figure 23.3. Entering the smart card PIN in the Gnome Desktop Manager
AD.EXAMPLE.COM\ad_user or ad_user@AD.EXAMPLE.COM.
23.2.4. Authenticating on an Identity Management Client with a Smart Card Using SSH
ssh utility, specify the path to the smart card reader module. For example:
$ ssh -I /usr/lib/libmypkcs11.so -l user@example.com host.example.com
Enter PIN for 'Smart Card':23.2.5. Additional Resources
- For details on smart-card authentication with OpenSSH, see Using Smart Cards to Supply Credentials to OpenSSH in the Security Guide.
23.3. Authenticating to an Identity Management System Remotely with a Smart Card
ssh utility. This enables you to use the remote system as the selected role.
23.3.1. Preparing the Local System for Smart-card Authentication
- Install the opensc package:
#
yum install opensc - Make sure the
pcscdservice for the smart-card daemon is started and enabled:#
systemctl start pcscd.socket pcscd.service#systemctl enable pcscd.socket pcscd.service
- On the Identity Management server, install the CA certificate:
#
ipa-cacert-manage -n "SmartCard CA" -t CT,C,C install ca.pem#ipa-certupdateRepeatipa-certupdatealso on all replicas and clients. - Restart the HTTP server on the Identity Management server:
#
systemctl restart httpdRepeatsystemctl restart httpdalso on all replicas.
23.3.2. Preparing the Remote Identity Management System for Smart-card Authentication
- Install the smart card certificate authority (CA) certificate in the
/etc/pki/nssdb/database on the remote system:#
certutil -A -d /etc/pki/nssdb/ -n "SmartCard CA" -t CT,C,C -i ca.pem - Make sure the sssd-dbus package is installed.
23.3.3. Linking the Smart Card Certificate and the User Entry in Active Directory
23.3.4. Authenticating to the Remote System from the Local System
- Insert the smart card.
- Launch
ssh, and specify the PKCS#11 library with the-Ioption:- As an Identity Management user:
$
ssh -I /usr/lib64/opensc-pkcs11.so -l idm_user server.idm.example.comEnter PIN for 'PIV_II (PIV Card Holder pin)': Last login: Thu Apr 6 12:49:32 2017 from 10.36.116.42 - As an Active Directory user:
$
ssh -I /usr/lib64/opensc-pkcs11.so -l ad_user@ad.example.com server.idm.example.comEnter PIN for 'PIV_II (PIV Card Holder pin)': Last login: Thu Apr 6 12:49:32 2017 from 10.36.116.42
- Optional. Use the
idutility to check that you are logged in as the intended user.- As an Identity Management user:
$
iduid=1928200001(idm_user) gid=1928200001(idm_user) groups=1928200001(idm_user) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 - As an Active Directory user:
$
iduid=1171201116(ad_user@ad.example.com) gid=1171201116(ad_user@ad.example.com) groups=1171201116(ad_user@ad.example.com),1171200513(domain users@ad.example.com) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
23.3.5. Additional Resources
- Authentication using
sshwith a smart card does not obtain a ticket-granting ticket (TGT) on the remote system. To obtain a TGT on the remote system, the administrator must configure Kerberos on the local system and enable Kerberos delegation. For an example of the required configuration, see this Kerberos knowledge base entry. - For details on smart-card authentication with OpenSSH, see Using Smart Cards to Supply Credentials to OpenSSH in the Security Guide.
23.4. Configuring a User Name Hint Policy for Smart-card Authentication
23.4.1. User Name Hints in Identity Management
- If the user name hint policy is enabled, the user is prompted for a user name and then can proceed with authentication.
- If the user name hint policy is disabled, the authentication fails without prompting.

Figure 23.4. User name hint in the Gnome Desktop Manager
- The Identity Management web UI authentication, because the GUI always displays the
Usernamefield sshauthentication, becausesshuses the current user’s login name or the name provided with the-loption or in theusername@hostformat- Console authentication, where the login name is always supplied
23.4.2. Enabling User Name Hints in Identity Management
Command Line: Enabling User Name Hints in Identity Management
- Log in as the Identity Management administrator:
$
kinit adminPassword for admin@IDM.EXAMPLE.COM: - Enable user name hints by using the
ipa certmapconfig-modcommand with the--promptusername=Trueoption.$
ipa certmapconfig-mod --promptusername=TRUEPrompt for the username: TRUETo disable user name hints, use the--promptusername=Falseoption.
Web UI: Enabling User Name Hints in Identity Management
- Click → → .
- Select Prompt for the username, and click .

Figure 23.5. Enabling user name hints in the web UI
Additional Resources
- For details on the
ipa certmapconfig-modcommand, execute it with the--helpoption.
23.5. PKINIT Smart-card Authentication in Identity Management
23.5.1. Preparing the Identity Management Client for PKINIT Authentication
- On the server, create a shell script to configure the client.
- Use the
ipa-advise config-client-for-smart-card-authcommand, and save its output to a file:#
ipa-advise config-client-for-smart-card-auth > client_smart_card_script.sh - Open the script file, and review its contents.
- Add execute permissions to the file using the
chmodutility:#
chmod +x client_smart_card_script.sh
- Copy the script to the client, and run it. Add the path to the PEM file with the certificate authority (CA) that signed the smart card certificate:
# ./client_smart_card_script.sh CA_cert.pem
- Make sure the krb5-pkinit package is installed.
- On the Identity Management server, install the CA certificate:
#
ipa-cacert-manage -n "SmartCard CA" -t CT,C,C install ca.pem#ipa-certupdateRepeatipa-certupdatealso on all replicas and clients. - Restart the HTTP server:
#
systemctl restart httpdRepeatsystemctl restart httpdalso on all replicas.
Note
certificate_verification parameter, for example if the Online Certificate Status Protocol (OCSP) servers defined in the certificate are not reachable from the client. For more information, see the sssd.conf(5) man page.
23.5.2. As an Identity Management User: Authenticate Using PKINIT on an Identity Management Client
kinit utility on an Identity Management client:
$ kinit -X X509_user_identity='PKCS11:opensc-pkcs11.so' idm_user-X option specifies the opensc-pkcs11.so module as the pre-authentication attribute. For details, see the kinit(1) man page.
23.5.3. As an Active Directory User: Authenticate Using PKINIT on an Identity Management Client
Prerequisites
- Configure the Active Directory server to trust the certificate authority (CA) that issued the smart card certificate. Import the CA in the NTAuth store (see Microsoft support), and add the CA as a trusted CA. See Active Directory documentation for details.
- Configure the Kerberos client to trust the CA that issued the smart card certificate:
- On the Identity Management client, open the
/etc/krb5.conffile. - Add the following lines to the file:
[libdefaults] [... file truncated ...] pkinit_eku_checking = kpServerAuth pkinit_kdc_hostname = adserver.ad.domain.com
- If the user certificates do not contain a certificate revocation list (CRL) distribution point extension, configure Active Directory to ignore revocation errors:
- Save the following REG-formatted content in a plain text file, and double-click the file to import it to the Windows Registry:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kdc] "UseCachedCRLOnlyAndIgnoreRevocationUnknownErrors"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA\Kerberos\Parameters] "UseCachedCRLOnlyAndIgnoreRevocationUnknownErrors"=dword:00000001
Alternatively, set the values manually using theregedit.exeapplication. - Reboot the Windows system to apply the changes.
Procedure
kinit utility on an Identity Management client. Specify the Active Directory user with the user name and domain name:
$ kinit -X X509_user_identity='PKCS11:opensc-pkcs11.so' ad_user@AD.DOMAIN.COM-X option specifies the opensc-pkcs11.so module as the pre-authentication attribute. For details, see the kinit(1) man page.
23.6. Authenticating to the Identity Management Web UI with a Smart Card
Note
23.6.1. Preparing the Identity Management Server for Smart-card Authentication in the Web UI
- On an Identity Management server, create a shell script to configure the server.
- Use the
ipa-advise config-server-for-smart-card-authcommand, and save its output to a file:#
ipa-advise config-server-for-smart-card-auth > server_smart_card_script.sh - Open the script file, and review its contents.
- Add execute permissions to the file using the
chmodutility:#
chmod +x server_smart_card_script.sh
- Run the script on all servers in the Identity Management domain.
- Make sure the sssd-dbus package is installed.
- On an Identity Management server, add the CA certificate to the NSS database used by the HTTP server:
#
ipa-cacert-manage -n "SmartCard CA" -t CT,C,C install ca.pem#ipa-certupdateRepeatipa-certupdateon all replicas and clients. - Restart the HTTP server and the Kerberos server:
#
systemctl restart httpd#systemctl restart krb5kdcRepeat the commands on all replicas.
23.6.2. Preparing the Browser for Smart-card Authentication
- Launch Firefox.
- Configure Firefox to read the certificate from the smart card.
- Select → → → →

Figure 23.6. Configuring security devices in Firefox
- Click . In the Load PKCS#11 Device window, fill out the following information:
- Module Name:
OpenSC - Module filename:
/usr/lib64/opensc-pkcs11.so

Figure 23.7. Device Manager in Firefox
- Click to confirm. Then click to close the Device Manager.
23.6.3. Authenticating to the Identity Management Web UI with a Smart Card as an Identity Management User
- Insert the smart card into the smart card reader.
- In the browser, navigate to the Identity Management web UI at
https://ipaserver.example.com/ipa/ui. - If the smart card certificate is linked to a single user account, do not fill out the Username field.If the smart card certificate is linked to multiple user accounts, fill out the Username field to specify the required account.
- Click .

Figure 23.8. in the Identity Management web UI
- Enter the smart card PIN when prompted.

Figure 23.9. Entering the smart card PIN
- A new window opens, proposing the certificate to use. Select the smart card certificate.

Figure 23.10. Selecting the smart card certificate
Additional Resources
- If the authentication fails, see Section A.4, “Investigating Smart Card Authentication Failures”.
23.6.4. Additional Resources
- For details on the Identity Management web UI, see Section 5.4, “The IdM Web UI”.
23.7. Integrating Identity Management Smart-card Authentication with Web Applications
23.7.1. Prerequisites for Web Application Authentication with Smart Cards
- Enroll the server as a client in the Identity Management domain.
- Install the sssd-dbus and mod_lookup_identity packages.
- Make sure Apache has a working HTTPS connection configured using the
mod_nssmodule.
23.7.2. Configuring Identity Management Smart-card Authentication for a Web Application
- Enable TLS renegotiation in the
mod_nssconfiguration in the/etc/httpd/conf.d/nss.conffile:NSSRenegotiation NSSRequireSafeNegotiation on
- Make sure that the CA issuing the user certificates is trusted for the client certificates in the
mod_nsscertificate database. The default location for the database is/etc/httpd/alias. - Add the web application. In this procedure, we are using an almost minimal example consisting of a login page and a protected area.
- The
/loginend point only lets the user provide a user name and sends the user to a protected part of the application. - The
/append point checks theREMOTE_USERenvironment variable. If the login was successful, the variable contains the ID of the logged-in user. Otherwise, the variable is unset.
- Create a directory, and set its group to
apacheand the mode to at least750. In this procedure, we are using a directory named/var/www/app/. - Create a file, and set its group to
apacheand the mode to at least750. In this procedure, we are using a file named/var/www/app/login.py.Save the following contents to the file:#! /usr/bin/env python def application(environ, start_response): status = '200 OK' response_body = """ <!DOCTYPE html> <html> <head> <title>Login</title> </head> <body> <form action='/app' method='get'> Username: <input type='text' name='username'> <input type='submit' value='Login with certificate'> </form> </body> </html> """ response_headers = [ ('Content-Type', 'text/html'), ('Content-Length', str(len(response_body))) ] start_response(status, response_headers) return [response_body] - Create a file, and set its group to
apacheand the mode to at least750. In this procedure, we are using a file named/var/www/app/protected.py.Save the following contents in the file:#! /usr/bin/env python def application(environ, start_response): try: user = environ['REMOTE_USER'] except KeyError: status = '400 Bad Request' response_body = 'Login failed.\n' else: status = '200 OK' response_body = 'Login succeeded. Username: {}\n'.format(user) response_headers = [ ('Content-Type', 'text/plain'), ('Content-Length', str(len(response_body))) ] start_response(status, response_headers) return [response_body] - Create a configuration file for your application. In this procedure, we are using a file named
/etc/httpd/conf.d/app.confwith the following contents:<IfModule !lookup_identity_module> LoadModule lookup_identity_module modules/mod_lookup_identity.so </IfModule> WSGIScriptAlias /login /var/www/app/login.py WSGIScriptAlias /app /var/www/app/protected.py <Location "/app"> NSSVerifyClient require NSSUserName SSL_CLIENT_CERT LookupUserByCertificate On LookupUserByCertificateParamName "username" </Location>In this file:- The first part loads
mod_lookup_identityif it is not already loaded. - The next part maps the
/loginand/append points to the respective Web Server Gateway Interface (WSGI) scripts. - The last part configures
mod_nssfor the/append point so that it requires a client certificate during the TLS handshake and uses it. In addition, it configures an optional request parameterusernameto look up the identity of the user.
Chapter 24. Managing Certificates for Users, Hosts, and Services
- Integrated IdM CA
- Integrated CAs can create, revoke, and issue certificates for users, hosts, and services. For more details, see Section 24.1, “Managing Certificates with the Integrated IdM CAs”.IdM supports creating lightweight sub-CAs. For more details, see Section 26.1, “Lightweight Sub-CAs”
- External CA
- An external CA is a CA other than the integrated IdM CA.Using IdM tools, you add certificates issued by these CAs to users, services, or hosts as well as remove them. For more details, see Section 24.2, “Managing Certificates Issued by External CAs”.
Note
24.1. Managing Certificates with the Integrated IdM CAs
24.1.1. Requesting New Certificates for a User, Host, or Service
- the IdM web UI, see the section called “Web UI: Requesting New Certificates”.
- the command line, see the section called “Command Line: Requesting New Certificates”.
certutil and openSSL utilities.
Important
Web UI: Requesting New Certificates
- Under the Identity tab, select the Users, Hosts, or Services subtab.
- Click the name of the user, host, or service to open its configuration page.

Figure 24.1. List of Hosts
- Click → .
- Optional: Select the issuing CA and profile ID.
- Follow the instructions on the screen for using
certutil. - Click .
Command Line: Requesting New Certificates
certutil in standard situations - see Section 24.1.1.1, “Requesting New Certificates Using certutil”. Request a new certificate using openSSL to enable a Kerberos alias to use a host or service certificate - see Section 24.1.1.2, “Requesting New Certificates Using openSSL”.
24.1.1.1. Requesting New Certificates Using certutil
- Create a new temporary certificate database, for instance:
# certutil -N -d ~/certdb/
- Create the certificate signing request (CSR) and redirect the output to a file. For example, to create a CSR for a 4096 bit certificate and to set the subject to CN=server.example.com,O=EXAMPLE.COM:
# certutil -R -d ~/certdb/ -a -g 4096 -s "CN=server.example.com,O=EXAMPLE.COM" -8 server.example.com > certificate_request.csr
- Submit the certificate request file to the server. Be sure to specify the Kerberos principal to associate with the newly-issued certificate:
# ipa cert-request certificate_request.csr --principal=host/server.example.com
- Certificate profile:
caIPAserviceCertTo select a custom profile, use the--profile-idoption with theipa cert-requestcommand. - Integrated CA:
ipa(IdM root CA)To select a sub-CA, use the--caoption with theipa cert-requestcommand.
24.1.1.2. Requesting New Certificates Using openSSL
- Create one or more aliases, for example test1/server.example.com, test2/server.example.com, for your Kerberos principal test/server.example.com. See Section 20.2.1, “Kerberos Principal Alias” for more details.
- In the CSR, add a subjectAltName for dnsName (server.example.com) and otherName (test2/server.example.com). To do this, configure the
openssl.conffile so that it includes the following line specifying the UPN otherName and subjectAltName:otherName=1.3.6.1.4.1.311.20.2.3;UTF8:test2/server.example.com@EXAMPLE.COM DNS.1 = server.example.com
- Create a certificate request using
openssl:openssl req -new -newkey rsa:2048 -keyout test2service.key -sha256 -nodes -out certificate_request.csr -config openssl.conf
24.1.2. Revoking Certificates with the Integrated IdM CAs
- the IdM web UI, see the section called “Web UI: Revoking Certificates”
- the command line, see the section called “Command Line: Revoking Certificates”
Table 24.1. Revocation Reasons
| ID | Reason | Explanation |
|---|---|---|
| 0 | Unspecified | |
| 1 | Key Compromised |
The key that issued the certificate is no longer trusted.
Possible causes: lost token, improperly accessed file.
|
| 2 | CA Compromised | The CA that issued the certificate is no longer trusted. |
| 3 | Affiliation Changed |
Possible causes:
|
| 4 | Superseded | A newer certificate has replaced the current certificate. |
| 5 | Cessation of Operation | The host or service is being decommissioned. |
| 6 | Certificate Hold | The certificate is temporarily revoked. You can restore the certificate later. |
| 8 | Remove from CRL | The certificate is not included in the certificate revocation list (CRL). |
| 9 | Privilege Withdrawn | The user, host, or service is no longer permitted to use the certificate. |
| 10 | Attribute Authority (AA) Compromise | The AA certificate is no longer trusted. |
Web UI: Revoking Certificates
- Open the Authentication tab, and select the Certificates subtab.
- Click the serial number of the certificate to open the certificate information page.

Figure 24.2. List of Certificates
- Click → .
- Select the reason for revoking, and click . See Table 24.1, “Revocation Reasons” for details.
Command Line: Revoking Certificates
ipa cert-revoke command, and specify:
- the certificate serial number
- a number that identifies the reason for the revocation; see Table 24.1, “Revocation Reasons” for details
1032 because of reason 1: Key Compromised:
$ ipa cert-revoke 1032 --revocation-reason=1
24.1.3. Restoring Certificates with the Integrated IdM CAs
- the IdM web UI, see the section called “Web UI: Restoring Certificates”
- the command line, see the section called “Command Line: Restoring Certificates”
Web UI: Restoring Certificates
- Open the Authentication tab, and select the Certificates subtab.
- Click the serial number of the certificate to open the certificate information page.

Figure 24.3. List of Certificates
- Click → .
Command Line: Restoring Certificates
ipa cert-remove-hold command and specify the certificate serial number. For example:
$ ipa cert-remove-hold 1032
24.2. Managing Certificates Issued by External CAs
24.2.1. Command Line: Adding and Removing Certificates Issued by External CAs
ipa user-add-certipa host-add-certipa service-add-cert
ipa user-remove-certipa host-remove-certipa service-remove-cert
- the name of the user, host, or service
- the Base64-encoded DER certificate
$ ipa user-add-cert user --certificate=MIQTPrajQAwg...
Note
user_cert.pem certificate to user:
$ ipa user-add-cert user --certificate="$(openssl x509 -outform der -in user_cert.pem | base64 -w 0)"
24.2.2. Web UI: Adding and Removing Certificates Issued by External CAs
- Open the Identity tab, and select the Users, Hosts, or Services subtab.
- Click on the name of the user, host, or service to open its configuration page.
- Click , next to the Certificates entry.

Figure 24.4. Adding a Certificate to a User Account
- Paste the certificate in Base64 or PEM encoded format into the text field, and click .
- Click to store the changes.
- Open the Identity tab, and select the Users, Hosts, or Services subtab.
- Click on the name of the user, host, or service to open its configuration page.
- Click the next to the certificate to delete, and select .
- Click to store the changes.
24.3. Listing and Displaying Certificates
Listing and Displaying Certificates in the Web UI
- Open the Identity tab, and select the Users, Hosts, or Services subtab.
- Click on the name of the user, host, or service to open its configuration page.

Figure 24.5. List of Hosts
- The configuration page lists all certificates assigned to the entry. Additionally, clicking displays a particular certificate.
- Open the Authentication tab, and select the Certificates subtab.
- A list of all certificates is displayed in the Certificates section. To display a particular certificate, click on its serial number.

Figure 24.6. List of Certificates
Listing Certificates from the Command Line
ipa cert-find command.
$ ipa cert-find ----------------------- 10 certificates matched ----------------------- Serial number (hex): 0x1 Serial number: 1 Status: VALID Subject: CN=Certificate Authority,O=EXAMPLE.COM ... ----------------------------- Number of entries returned 10 -----------------------------
--issuedon-from or --issuedon-to options to specify the start and end points or a period of time.
ipa cert-find --issuedon-from=2018-01-07 --issuedon-to=2018-02-07
ipa cert-find with the --help option added.
Displaying Certificates from the Command Line
ipa cert-show command and specify the serial number.
$ ipa cert-show 132 Serial number: 132 Certificate: MIIDtzCCAp+gAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMR8wHQYDVQQKExZMQUIu ... LxIQjrEFtJmoBGb/TWRlwGEWy1ayr4iTEf1ayZ+RGNylLalEAtk9RLjEjg== Subject: CN=Certificate Authority,O=EXAMPLE.COM Issuer: CN=Certificate Authority,O=EXAMPLE.COM Not Before: Sun Jun 08 05:51:11 2014 UTC Not After: Thu Jun 08 05:51:11 2034 UTC Serial number (hex): 0x132 Serial number: 132
ipa cert-show and specify the entry. For example, to display the certificate assigned to a user:
$ ipa user-show user User login: user ... Certificate: MIICfzCCAWcCAQA... ...
--out option to ipa cert-show.
$ ipa cert-show certificate_serial_number --out=path_to_file
--out option exports all of them. The certificate or certificates are exported as PEM objects.
24.4. Certificate Profiles
- whether the CA can accept a certificate signing request (CSR)
- what features and extensions should be present on the certificate
caIPAserviceCert and IECUserRoles. In addition, custom profiles can be imported.
Note
24.4.1. Certificate Profile Management from the Command Line
certprofile plug-in for management of IdM profiles allows privileged users to import, modify, or remove IdM certificate profiles. To display all commands supported by the plug-in, run the ipa certprofile command:
$ ipa certprofile
Manage Certificate Profiles
...
EXAMPLES:
Import a profile that will not store issued certificates:
ipa certprofile-import ShortLivedUserCert \
--file UserCert.profile --desc "User Certificates" \
--store=false
Delete a certificate profile:
ipa certprofile-del ShortLivedUserCert
...
certprofile operations, you must be operating as a user who has the required permissions. IdM includes the following certificate profile-related permissions by default:
- System: Read Certificate Profiles
- Enables users to read all profile attributes.
- System: Import Certificate Profile
- Enables users to import a certificate profile into IdM.
- System: Delete Certificate Profile
- Enables users to delete an existing certificate profile.
- System: Modify Certificate Profile
- Enables users to modify the profile attributes and to disable or enable the profile.
CA Administrator privilege. For more information on IdM role-based access controls and managing permissions, see Section 10.4, “Defining Role-Based Access Controls”.
Note
--profile-id option can be added to the ipa cert-request command to specify which profile to use. If no profile ID is specified, the default caIPAserviceCert profile is used for the certificate.
ipa certprofile commands for profile management. For complete information about a command, run it with the --help option added, for example:
$ ipa certprofile-mod --help Usage: ipa [global-options] certprofile-mod ID [options] Modify Certificate Profile configuration. Options: -h, --help show this help message and exit --desc=STR Brief description of this profile --store=BOOL Whether to store certs issued using this profile ...
Importing Certificate Profiles
ipa certprofile-import command. Running the command without any options starts an interactive session in which the certprofile-import script prompts your for the information required to import the certificate.
$ ipa certprofile-import Profile ID: smime Profile description: S/MIME certificates Store issued certificates [True]: TRUE Filename of a raw profile. The XML format is not supported.: smime.cfg ------------------------ Imported profile "smime" ------------------------ Profile ID: smime Profile description: S/MIME certificates Store issued certificates: TRUE
ipa certprofile-import command accepts several command-line options. Most notably:
--file- This option passes the file containing the profile configuration directly to
ipa certprofile-import. For example:$ ipa certprofile-import --file=smime.cfg
--store- This option sets the
Store issued certificatesattribute. It accepts two values:True, which delivers the issued certificates to the client and stores them in the target IdM principal'suserCertificateattribute.False, which delivers the issued certificates to the client, but does not store them in IdM. This option is most commonly-used when issuing multiple short-term certificates is required.
ipa certprofile-import is already in use or if the profile content is incorrect. For example, the import fails if a required attribute is missing or if the profile ID value defined in the supplied file does not match the profile ID specified with ipa certprofile-import.
ipa certprofile-show command with the --out option, which exports a specified existing profile to a file. For example:
$ ipa certprofile-show caIPAserviceCert --out=file_name
Displaying Certificate Profiles
ipa certprofile-find command:
$ ipa certprofile-find ------------------ 3 profiles matched ------------------ Profile ID: caIPAserviceCert Profile description: Standard profile for network services Store issued certificates: TRUE Profile ID: IECUserRoles ...
ipa certprofile-show command:
$ ipa certprofile-show profile_ID Profile ID: profile_ID Profile description: S/MIME certificates Store issued certificates: TRUE
Modifying Certificate Profiles
ipa certprofile-mod command. Pass the required modifications with the command using the command-line options accepted by ipa certprofile-mod. For example, to modify the description of a profile and change whether IdM stores the issued certificates:
$ ipa certprofile-mod profile_ID --desc="New description" --store=False ------------------------------------ Modified Certificate Profile "profile_ID" ------------------------------------ Profile ID: profile_ID Profile description: New description Store issued certificates: FALSE
--file option. For example:
$ ipa certprofile-mod profile_ID --file=new_configuration.cfg
Deleting Certificate Profiles
ipa certprofile-del command:
$ ipa certprofile-del profile_ID ----------------------- Deleted profile "profile_ID" -----------------------
24.4.2. Certificate Profile Management from the Web UI
- Open the Authentication tab and the Certificates subtab.
- Open the Certificate Profiles section.

Figure 24.7. Certificate Profile Management in the Web UI
- Click on the name of the profile to open the profile configuration page.
- In the profile configuration page, fill in the required information.
- Click to confirm the new configuration.

Figure 24.8. Modifying a Certificate Profile in the Web UI
Store issued certificates option, the issued certificates are delivered to the client as well as stored in the target IdM principal's userCertificate attribute. If the option is disabled, the issued certificates are delivered to the client, but not stored in IdM. Storing certificates is often disabled when issuing multiple short-lived certificates is required.
- It is not possible to import a certificate profile in the web UI. To import a certificate, use the
ipa certprofile-importcommand. - It is not possible to set, add, or delete attribute and value pairs. To modify the attribute and value pairs, use the
ipa certprofile-modcommand. - It is not possible to import updated certificate profile configuration. To import a file containing updated profile configuration, use the
ipa certprofile-mod --file=file_namecommand.
24.4.3. Upgrading IdM Servers with Certificate Profiles
24.5. Certificate Authority ACL Rules
- an ACL can permit access to multiple profiles
- an ACL can have multiple users, services, hosts, user groups, and host groups associated with it
Note
24.5.1. CA ACL Management from the Command Line
caacl plug-in for management of CA ACL rules allows privileged users to add, display, modify, or delete a specified CA ACL. To display all commands supported by the plug-in, run the ipa caacl command:
$ ipa caacl
Manage CA ACL rules.
...
EXAMPLES:
Create a CA ACL "test" that grants all users access to the
"UserCert" profile:
ipa caacl-add test --usercat=all
ipa caacl-add-profile test --certprofiles UserCert
Display the properties of a named CA ACL:
ipa caacl-show test
Create a CA ACL to let user "alice" use the "DNP3" profile on "DNP3-CA":
ipa caacl-add alice_dnp3
ipa caacl-add-ca alice_dnp3 --cas DNP3-CA
ipa caacl-add-profile alice_dnp3 --certprofiles DNP3
ipa caacl-add-user alice_dnp3 --user=alice
...
caacl operations, you must be operating as a user who has the required permissions. IdM includes the following CA ACL-related permissions by default:
- System: Read CA ACLs
- Enables the user to read all attributes of the CA ACL.
- System: Add CA ACL
- Enables the user to add a new CA ACL.
- System: Delete CA ACL
- Enables the user to delete an existing CA ACL.
- System: Modify CA ACL
- Enables the user to modify an attribute of the CA ACL and to disable or enable the CA ACL.
- System: Manage CA ACL membership
- Enables the user to manage the CA, profile, user, host, and service membership in the CA ACL.
CA Administrator privilege. For more information on IdM role-based access controls and managing permissions, see Section 10.4, “Defining Role-Based Access Controls”.
ipa caacl commands for CA ACL management. For complete information about a command, run it with the --help option added, for example:
$ ipa caacl-mod --help Usage: ipa [global-options] caacl-mod NAME [options] Modify a CA ACL. Options: -h, --help show this help message and exit --desc=STR Description --cacat=['all'] CA category the ACL applies to --profilecat=['all'] Profile category the ACL applies to ...
Creating CA ACLs
ipa caacl-add command. Running the command without any options starts an interactive session in which the ipa caacl-add script prompts your for the required information about the new CA ACL.
$ ipa caacl-add ACL name: smime_acl ------------------------ Added CA ACL "smime_acl" ------------------------ ACL name: smime_acl Enabled: TRUE
ipa caacl-add are the options that associate a CA ACL with a CA, certificate profile, user, host, or service category:
--cacat--profilecat--usercat--hostcat--servicecat
all value with these options, which associates the CA ACL with all CAs, profiles, users, hosts, or services. For example, to associate the CA ACL with all users and user groups:
$ ipa caacl-add ca_acl_name --usercat=all
--usercat=all option and then add a user to the CA ACL with the ipa caacl-add-user --users=user_name command.
Note
$ ipa cert-request CSR-FILE --principal user --profile-id profile_id ipa: ERROR Insufficient access: Principal 'user' is not permitted to use CA '.' with profile 'profile_id' for certificate issuance.
all user category.
Displaying CA ACLs
ipa caacl-find command:
$ ipa caacl-find ----------------- 2 CA ACLs matched ----------------- ACL name: hosts_services_caIPAserviceCert Enabled: TRUE ...
ipa caacl-find accepts the --cacat, --profilecat, --usercat, --hostcat, and --servicecat options, which can be used to filter the results of the search to CA ACLs with the corresponding CA, certificate profile, user, host, or service category. Note that IdM only accepts the all category with these options. For more information about the options, see the section called “Creating CA ACLs”.
ipa caacl-show command:
$ ipa caacl-show ca_acl_name ACL name: ca_acl_name Enabled: TRUE Host category: all ...
Modifying CA ACLs
ipa caacl-mod command. Pass the required modifications using the command-line options accepted by ipa caacl-mod. For example, to modify the description of a CA ACL and associate the CA ACL with all certificate profiles:
$ ipa caacl-mod ca_acl_name --desc="New description" --profilecat=all --------------------------- Modified CA ACL "ca_acl_name" --------------------------- ACL name: smime_acl Description: New description Enabled: TRUE Profile category: all
ipa caacl-mod are the --cacat, --profilecat, --usercat, --hostcat, and --servicecat options. For a description of these options, see the section called “Creating CA ACLs”.
Disabling and Enabling CA ACLs
ipa caacl-disable command:
$ ipa caacl-disable ca_acl_name --------------------------- Disabled CA ACL "ca_acl_name" ---------------------------
ipa caacl-enable command:
$ ipa caacl-enable ca_acl_name --------------------------- Enabled CA ACL "ca_acl_name" ---------------------------
Deleting CA ACLs
ipa caacl-del command:
$ ipa caacl-del ca_acl_name
Adding Entries to CA ACLs and Removing Entries from CA ACLs
ipa caacl-add-* and ipa caacl-remove-* commands, you can add new entries to a CA ACL or remove existing entries.
ipa caacl-add-caandipa caacl-remove-ca- Adds or removes a CA.
ipa caacl-add-hostandipa caacl-remove-host- Adds or removes a host or host group.
ipa caacl-add-profileandipa caacl-remove-profile- Adds or removes a profile.
ipa caacl-add-serviceandipa caacl-remove-service- Adds or removes a service.
ipa caacl-add-userandipa caacl-remove-user- Adds or removes a user or group.
$ ipa caacl-add-user ca_acl_name --groups=group_name
ipa caacl-add-user --users=user_name command on a CA ACL specified with the --usercat=all option, the command fails:
$ ipa caacl-add-user ca_acl_name --users=user_name ipa: ERROR: users cannot be added when user category='all'
Note
$ ipa cert-request CSR-FILE --principal user --profile-id profile_id ipa: ERROR Insufficient access: Principal 'user' is not permitted to use CA '.' with profile 'profile_id' for certificate issuance.
all user category, as described in the section called “Creating CA ACLs”.
--help option added. For example:
$ ipa caacl-add-user --help
24.5.2. CA ACL Management from the Web UI
- Open the Authentication tab and the Certificates subtab.
- Open the CA ACLs section.

Figure 24.9. CA ACL Rules Management in the Web UI
- Click on the name of the CA ACL to open the CA ACL configuration page.
- In the CA ACL configuration page, fill in the required information.The Profiles and Permitted to have certificates issued sections allow you to associate the CA ACL with certificate profiles, users or user groups, hosts or host groups, or services. You can either add these objects using the buttons, or select the Anyone option to associate the CA ACL with all users, hosts, or services.
- Click to confirm the new configuration.

Figure 24.10. Modifying a CA ACL Rule in the Web UI
24.6. Using Certificate Profiles and ACLs to Issue User Certificates with the IdM CAs
Issuing Certificates to Users from the Command Line
- Create or import a new custom certificate profile for handling requests for user certificates. For example:
$ ipa certprofile-import certificate_profile --file=certificate_profile.cfg --store=True
- Add a new Certificate Authority (CA) ACL that will be used to permit requesting certificates for user entries. For example:
$ ipa caacl-add users_certificate_profile --usercat=all
- Add the custom certificate profile to the CA ACL.
$ ipa caacl-add-profile users_certificate_profile --certprofiles=certificate_profile
- Generate a certificate request for the user. For example, using OpenSSL:
$ openssl req -new -newkey rsa:2048 -days 365 -nodes -keyout private.key -out cert.csr -subj '/CN=user'
- Run the
ipa cert-requestcommand to have the IdM CA issue a new certificate for the user.$ ipa cert-request cert.csr --principal=user --profile-id=certificate_profile
Optionally pass the--ca sub-CA_nameoption to the command to request the certificate from a sub-CA instead of the root CAipa.
ipa user-show command:
$ ipa user-show user
User login: user
...
Certificate: MIICfzCCAWcCAQA...
...
Issuing Certificates to Users in the Web UI
- Create or import a new custom certificate profile for handling requests for user certificates. Importing profiles is only possible from the command line, for example:
$ ipa certprofile-import certificate_profile --file=certificate_profile.txt --store=True
For information about certificate profiles, see Section 24.4, “Certificate Profiles”. - In the web UI, under the Authentication tab, open the CA ACLs section.

Figure 24.11. CA ACL Rules Management in the Web UI
Click at the top of the list of Certificate Authority (CA) ACLs to add a new CA ACL that permits requesting certificates for user entries.- In the Add CA ACL window that opens, fill in the required information about the new CA ACL.

Figure 24.12. Adding a New CA ACL
Then, click to go directly to the CA ACL configuration page. - In the CA ACL configuration page, scroll to the Profiles section and click at the top of the profiles list.

Figure 24.13. Adding a Certificate Profile to the CA ACL
- Add the custom certificate profile to the CA ACL by selecting the profile and moving it to the Prospective column.

Figure 24.14. Selecting a Certificate Profile
Then, click . - Scroll to the Permitted to have certificates issued section to associate the CA ACL with users or user groups.You can either add users or groups using the buttons, or select the Anyone option to associate the CA ACL with all users.

Figure 24.15. Adding Users to the CA ACL
- In the Permitted to have certificates issued section, you can associate the CA ACL with one or more CAs.You can either add CAs using the button, or select the Any CA option to associate the CA ACL with all CAs.

Figure 24.16. Adding CAs to the CA ACL
- At the top of the CA ACL configuration page, click to confirm the changes to the CA ACL.
- Request a new certificate for the user.
- Under the Identity tab and the Users subtab, choose the user for whom the certificate will be requested. Click on the user's user name to open the user entry configuration page.
- Click at the top of the user configuration page, and then click New Certificate.

Figure 24.17. Requesting a Certificate for a User
- Fill in the required information.

Figure 24.18. Issuing a Certificate for a User
Then, click .
Chapter 25. Storing Authentication Secrets with Vaults
- passwords
- PINs
- private SSH keys
Note
- Storing personal secrets of a user
- See Section 25.4, “Storing a User's Personal Secret” for details.
- Storing a secret for a service
- See Section 25.5, “Storing a Service Secret in a Vault” for details.
- Storing a common secret used by multiple users
- See Section 25.6, “Storing a Common Secret for Multiple Users” for details.
25.1. How Vaults Work
25.1.1. Vault Owners, Members, and Administrators
- Vault owner
- A vault owner is a user or service with basic management privileges on the vault. For example, a vault owner can modify the properties of the vault or add new vault members.Each vault must have at least one owner. A vault can also have multiple owners.
- Vault member
- A vault member is a user or service who can access a vault created by another user or service.
- Vault administrator
- Vault administrators have unrestricted access to all vaults and are allowed to perform all vault operations.
Note
Symmetric and asymmetric vaults are protected with a password or key and apply special access control rules (see Section 25.1.2, “Standard, Symmetric, and Asymmetric Vaults”). The administrator must meet these rules to:- access secrets in symmetric and asymmetric vaults
- change or reset the vault password or key
A vault administrator is any user with theVault Administratorsprivilege. See Section 10.4, “Defining Role-Based Access Controls” for information on defining user privileges.
Vault User
ipa vault-show command, also displays Vault user for user vaults:
$ ipa vault-show my_vault
Vault name: my_vault
Type: standard
Owner users: user
Vault user: user25.1.2. Standard, Symmetric, and Asymmetric Vaults
- Standard vault
- Vault owners and vault members can archive and retrieve the secrets without having to use a password or key.
- Symmetric vault
- Secrets in the vault are protected with a symmetric key. Vault members and vault owners can archive and retrieve the secrets, but they must provide the vault password.
- Asymmetric vault
- Secrets in the vault are protected with an asymmetric key. Users archive the secret using a public key and retrieve it using a private key. Vault members can only archive secrets, while vault owners can both archive and retrieve secrets.
25.1.4. Vault Containers
- User container: a private container for a user
- This container stores: user vaults for a particular user.
- Service container: a private container for a service
- This container stores: service vaults for a particular service.
- Shared container
- This container stores: vaults that can be shared by multiple users or services.
25.2. Prerequisites for Using Vaults
# ipa-kra-install
25.3. Getting Help for Vault Commands
$ ipa help vault
--help option to the command:
$ ipa vault-add --help
Vault Commands Fail with vault not found Error
--useror--servicespecify the owner of the vault you want to view$ ipa vault-show user_vault --user user
--sharedspecify that the vault you want to view is a shared vault
--user, IdM informs you it did not find the vault:
[admin@server ~]$ ipa vault-show user_vault ipa: ERROR: user_vault: vault not found
25.4. Storing a User's Personal Secret
useris the user who wants to create the vaultmy_vaultis the vault used to store the user's certificate- the vault type is
standard, so that accessing the archived certificate does not require the user to provide a vault password secret.txtis the file containing the certificate that the user wants to store in the vaultsecret_exported.txtis the file to which the user exports the archived certificate
25.4.1. Archiving a User's Personal Secret
- Log in as
user:$ kinit user
- Use the
ipa vault-addcommand to create a standard vault:$ ipa vault-add my_vault --type standard ---------------------- Added vault "my_vault" ---------------------- Vault name: my_vault Type: standard Owner users: user Vault user: user
Important
Make sure the first user vault for a user is created by the same user. For example, if another user, such asadmin, creates the first user vault foruser1, the owner of the user's vault container will also beadmin, anduser1will be unable to access the user vault or create new user vaults. See also Section B.5.1, “Users Cannot Access Their Vault Due To Insufficient 'add' Privilege”. - Use the
ipa vault-archive --incommand to archive thesecret.txtfile into the vault:$ ipa vault-archive my_vault --in secret.txt ----------------------------------- Archived data into vault "my_vault" -----------------------------------
Note
One vault can only store one secret.
25.4.2. Retrieving a User's Personal Secret
- Log in as
user:$ kinit user
- Use the
ipa vault-retrieve --outcommand to retrieve the contents of the vault and save them into thesecret_exported.txtfile.$ ipa vault-retrieve my_vault --out secret_exported.txt -------------------------------------- Retrieved data from vault "my_vault" --------------------------------------
25.5. Storing a Service Secret in a Vault
adminis the administrator who manages the service passwordhttp_passwordis the name of the private user vault created by the administratorpassword.txtis the file containing the service passwordpassword_vaultis the vault created for the serviceHTTP/server.example.comis the service whose password is being archivedservice-public.pemis the service public key used to encrypt the password stored inpassword_vault
25.5.1. Creating a User Vault to Store a Service Password
- Log in as the administrator:
$ kinit admin
- Create a standard user vault:
$ ipa vault-add http_password --type standard --------------------------- Added vault "http_password" --------------------------- Vault name: http_password Type: standard Owner users: admin Vault user: admin
- Archive the service password into the vault:
$ ipa vault-archive http_password --in password.txt ---------------------------------------- Archived data into vault "http_password" ----------------------------------------
Warning
After archiving the password into the vault, deletepassword.txtfrom your system.
25.5.2. Provisioning a Service Password from a User Vault to Service Instances
- Log in as the administrator:
$ kinit admin
- Obtain the public key of the service instance. For example, using the
opensslutility:- Generate the
service-private.pemprivate key.$ openssl genrsa -out service-private.pem 2048 Generating RSA private key, 2048 bit long modulus .+++ ...........................................+++ e is 65537 (0x10001)
- Generate the
service-public.pempublic key based on the private key.$ openssl rsa -in service-private.pem -out service-public.pem -pubout writing RSA key
- Create an asymmetric vault as the service instance vault, and provide the public key:
$ ipa vault-add password_vault --service HTTP/server.example.com --type asymmetric --public-key-file service-public.pem ---------------------------- Added vault "password_vault" ---------------------------- Vault name: password_vault Type: asymmetric Public key: LS0tLS1C...S0tLS0tCg== Owner users: admin Vault service: HTTP/server.example.com@EXAMPLE.COM
The password archived into the vault will be protected with the key. - Retrieve the service password from the administrator's private vault, and then archive it into the new service vault:
$ ipa vault-retrieve http_password --out password.txt ----------------------------------------- Retrieved data from vault "http_password" -----------------------------------------$ ipa vault-archive password_vault --service HTTP/server.example.com --in password.txt ----------------------------------- Archived data into vault "password_vault" -----------------------------------This encrypts the password with the service instance public key.Warning
After archiving the password into the vault, deletepassword.txtfrom your system.
25.5.3. Retrieving a Service Password for a Service Instance
- Log in as the administrator:
$ kinit admin
- Obtain a Kerberos ticket for the service:
# kinit HTTP/server.example.com -k -t /etc/httpd/conf/ipa.keytab
- Retrieve the service vault password:
$ ipa vault-retrieve password_vault --service HTTP/server.example.com --private-key-file service-private.pem --out password.txt ------------------------------------ Retrieved data from vault "password_vault" ------------------------------------
25.5.4. Changing Service Vault Password
- Archive the new password in the administrator's user vault:
$ ipa vault-archive http_password --in new_password.txt ---------------------------------------- Archived data into vault "http_password" ----------------------------------------
This overwrites the current password stored in the vault. - Re-provision the new password to each service instance excluding the compromised instance.
- Retrieve the new password from the administrator's vault:
$ ipa vault-retrieve http_password --out password.txt ----------------------------------------- Retrieved data from vault "http_password" -----------------------------------------
- Archive the new password into the service instance vault:
$ ipa vault-archive password_vault --service HTTP/server.example.com --in password.txt ----------------------------------- Archived data into vault "password_vault" -----------------------------------
Warning
After archiving the password into the vault, deletepassword.txtfrom your system.
Chapter 26. Managing Certificates and Certificate Authorities
26.1. Lightweight Sub-CAs
ipa CA is the root CA of the certificate system. All sub-CAs you create, are subordinated to this root CA.
26.1.1. Creating a Lightweight Sub-CA
Creating a Sub-CA from the Web UI
- Open the Authentication tab, and select the Certificates subtab.
- Select Certificate Authorities and click .
- Enter the name and subject DN for the CA.

Figure 26.1. Adding a CA
The subject DN must be unique in the IdM CA infrastructure.
Creating a Sub-CA from the Command Line
[root@ipaserver ~]# ipa ca-add vpn-ca --subject="CN=VPN,O=IDM.EXAMPLE.COM" ------------------- Created CA "vpn-ca" ------------------- Name: vpn-ca Authority ID: ba83f324-5e50-4114-b109-acca05d6f1dc Subject DN: CN=VPN,O=IDM.EXAMPLE.COM Issuer DN: CN=Certificate Authority,O=IDM.EXAMPLE.COM
- Name
- Name of the CA.
- Authority ID
- Automatically created, individual ID for the CA.
- Subject DN
- Subject distinguished name (DN). The subject DN must be unique in the IdM CA infrastructure.
- Issuer DN
- Parent CA that issued the sub-CA certificate. All sub-CAs are created as a child of the IdM root CA.
[root@ipaserver ~]# certutil -d /etc/pki/pki-tomcat/alias/ -L
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
caSigningCert cert-pki-ca CTu,Cu,Cu
Server-Cert cert-pki-ca u,u,u
auditSigningCert cert-pki-ca u,u,Pu
caSigningCert cert-pki-ca ba83f324-5e50-4114-b109-acca05d6f1dc u,u,u
ocspSigningCert cert-pki-ca u,u,u
subsystemCert cert-pki-ca u,u,uNote
26.1.2. Removing a Lightweight Sub-CA
Removing a Sub-CA from the Web UI
- Open the Authentication tab, and select the Certificates subtab.
- Select Certificate Authorities.
- Select the sub-CA to remove and click .
- Click to confirm.
Removing a Sub-CA from the Command Line
[root@ipaserver ~]# ipa ca-del vpn-ca ------------------- Deleted CA "vpn-ca" -------------------
26.2. Renewing Certificates
- automatic certificate renewal, see Section 26.2.1, “Renewing Certificates Automatically”
- manual certificate renewal, see Section 26.2.2, “Renewing CA Certificates Manually”
26.2.1. Renewing Certificates Automatically
certmonger service automatically renews the following certificates 28 days before their expiration date:
- CA certificate issued by the IdM CA as the root CA
- Subsystem and server certificates issued by the integrated IdM CA that are used by internal IdM services
certmonger tracking list. To update the tracking list:
[root@ipaserver ~]# ipa-certupdate trying https://idmserver.idm.example.com/ipa/json Forwarding 'schema' to json server 'https://idmserver.idm.example.com/ipa/json' trying https://idmserver.idm.example.com/ipa/json Forwarding 'ca_is_enabled' to json server 'https://idmserver.idm.example.com/ipa/json' Forwarding 'ca_find/1' to json server 'https://idmserver.idm.example.com/ipa/json' Systemwide CA database updated. Systemwide CA database updated. The ipa-certupdate command was successful
Note
certmonger service cannot automatically renew certificates signed by an external CA.
certmonger monitors certificate expiration dates, see Tracking Certificates with certmonger in the System-Level Authentication Guide.
certmonger log messages in the /var/log/messages file:
- After a certificate is renewed,
certmongerrecords message like the following to indicate that the renewal operation has succeeded or failed:Certificate named "NSS Certificate DB" in token "auditSigningCert cert-pki-ca" in database "/var/lib/pki-ca/alias" renew success - As the certificate nears its expiration,
certmongerlogs the following message:certmonger: Certificate named "NSS Certificate DB" in token "auditSigningCert cert-pki-ca" in database "/var/lib/pki-ca/alias" will not be valid after 20160204065136.
26.2.2. Renewing CA Certificates Manually
ipa-cacert-manage utility to manually renew:
- self-signed IdM CA certificate
- externally-signed IdM CA certificate
ipa-cacert-manage renew command use the same key pair and subject name as the old certificates. Renewing a certificate does not remove its previous version to enable certificate rollover.
26.2.2.1. Renewing a Self-Signed IdM CA Certificate Manually
- Run the
ipa-cacert-manage renewcommand. The command does not require you to specify the path to the certificate. - The renewed certificate is now present in the LDAP certificate store and in the
/etc/pki/pki-tomcat/aliasNSS database. - Run the
ipa-certupdateutility on all servers and clients to update them with the information about the new certificate from LDAP. You must runipa-certupdateon every server and client separately.Important
Always runipa-certupdateafter manually installing a certificate. If you do not, the certificate will not be distributed to the other machines.
certutil utility to list the certificates in the database. For example:
# certutil -L -d /etc/pki/pki-tomcat/alias
26.2.2.2. Renewing an Externally-Signed IdM CA Certificate Manually
- Run the
ipa-cacert-manage renew --external-cacommand. - The command creates the
/var/lib/ipa/ca.crtCSR file. Submit the CSR to the external CA to get the renewed CA certificate issued. - Run
ipa-cacert-manage renewagain, and this time specify the renewed CA certificate and the external CA certificate chain files using the--external-cert-fileoption. For example:# ipa-cacert-manage renew --external-cert-file=/tmp/servercert20110601.pem --external-cert-file=/tmp/cacert.pem
- The renewed CA certificate and the external CA certificate chain are now present in the LDAP certificate store and in the
/etc/pki/pki-tomcat/alias/NSS database. - Run the
ipa-certupdateutility on all servers and clients to update them with the information about the new certificate from LDAP. You must runipa-certupdateon every server and client separately.Important
Always runipa-certupdateafter manually installing a certificate. If you do not, the certificate will not be distributed to the other machines.
certutil utility to list the certificates in the database. For example:
# certutil -L -d /etc/pki/pki-tomcat/alias/
26.3. Installing a CA Certificate Manually
ipa-cacert-manage install command. For example, the command allows you to change the current certificate when it is nearing its expiration date.
- Run the
ipa-cacert-manage installcommand, and specify the path to the file containing the certificate. The command accepts PEM-formatted certificate files:[root@server ~]# ipa-cacert-manage install /etc/group/cert.pem
The certificate is now present in the LDAP certificate store. - Run the
ipa-certupdateutility on all servers and clients to update them with the information about the new certificate from LDAP. You must runipa-certupdateon every server and client separately.Important
Always runipa-certupdateafter manually installing a certificate. If you do not, the certificate will not be distributed to the other machines.
ipa-cacert-manage install command can take the following options:
- -n
- gives the nickname of the certificate; the default value is the subject name of the certificate
- -t
- specifies the trust flags for the certificate in the
certutilformat; the default value isC,,. For information about the format in which to specify the trust flags, see the ipa-cacert-manage(1) man page.
26.4. Changing the Certificate Chain
ipa-cacert-manage renew.
- Self-signed CA certificate → externally-signed CA certificate
- Add the
--external-caoption toipa-cacert-manage renew. This renews the self-signed CA certificate as an externally-signed CA certificate.For details on running the command with this option, see Section 26.2.2, “Renewing CA Certificates Manually”. - Externally-signed CA certificate → self-signed CA certificate
- Add the
--self-signedoption toipa-cacert-manage renew. This renew the externally-signed CA certificate as a self-signed CA certificate.
26.5. Allowing IdM to Start with Expired Certificates
- Apache, Kerberos, DNS, and LDAP services will continue working. With these services active, users will be able to log in to the IdM domain.
- Client services that require SSL for access will still fail. For example,
sudowill fail because it requires SSSD on IdM clients, and SSSD needs SSL to contact IdM.
Important
- Configure the
mod_nssmodule for the Apache server to not enforce valid certificates.- Open the
/etc/httpd/conf.d/nss.conffile. - Set the
NSSEnforceValidCertsparameter tooff:NSSEnforceValidCerts off
- Restart Apache.
# systemctl restart httpd.service
- Make sure that validity checks are disabled for the LDAP directory server. To do this, verify that the
nsslapd-validate-certattribute is set towarn:# ldapsearch -h server.example.com -p 389 -D "cn=directory manager" -w secret -LLL -b cn=config -s base "(objectclass=*)" nsslapd-validate-cert dn: cn=config nsslapd-validate-cert: warn
If the attribute is not set towarn, change it:# ldapmodify -D "cn=directory manager" -w secret -p 389 -h server.example.com dn: cn=config changetype: modify replace: nsslapd-validate-cert nsslapd-validate-cert: warn
- Restart the directory server.
# systemctl restart dirsrv.target
26.6. Installing Third-Party Certificates for HTTP or LDAP
- your private SSL key (
ssl.keyin the procedure below) - your SSL certificate (
ssl.crtin the procedure below)
Prerequisites
ssl.crt certificate must be signed by a CA known by the service you are loading the certificate into. If this is not the case, install the CA certificate of the CA that signed ssl.crt into IdM, as described in Section 26.3, “Installing a CA Certificate Manually”.
ssl.crt.
Installing the Third-Party Certificate
- Use the
ipa-server-certinstallutility to install the certificate. Specify where you want to install it:--httpinstalls the certificate in the Apache Web Server--dirsrvinstalls the certificate on the Directory Server
For example, to install the SSL certificate into both:# ipa-server-certinstall --http --dirsrv ssl.key ssl.crt
- Restart the server into which you installed the certificate.
- To restart the Apache Web Server:
# systemctl restart httpd.service
- To restart the Directory Server:
# systemctl restart dirsrv@REALM.service
- To verify that the certificate has been correctly installed, make sure it is present in the certificate database.
- To display the Apache certificate database:
# certutil -L -d /etc/httpd/alias
- To display the Directory Server certificate database:
# certutil -L -d /etc/dirsrv/slapd-REALM/
26.7. Configuring OCSP Responders
http://ca-server.example.com/ca/ocsp. Clients can connect to this URL to check the validity of a certificate.
Note
26.7.1. Changing the CRL Update Interval
- Stop the CA server.
# systemctl stop pki-tomcatd@pki-tomcat.service
- Open the
/var/lib/pki/pki-tomcat/conf/ca/CS.cfgfile, and change theca.crl.MasterCRL.autoUpdateIntervalvalue to the new interval setting. For example, to generate the CRL every 60 minutes:ca.crl.MasterCRL.autoUpdateInterval=60
- Start the CA server.
# systemctl start pki-tomcatd@pki-tomcat.service
26.8. Installing a CA Into an Existing IdM Domain
Note
- Installing an IdM Certificate Server
- Use the following command to install the IdM Certificate Server CA:
[root@ipa-server ~] ipa-ca-install
- Run the
ipa-certupdateutility on all servers and clients to update them with the information about the new certificate from LDAP. You must runipa-certupdateon every server and client separately.Important
Always runipa-certupdateafter manually installing a certificate. If you do not, the certificate will not be distributed to the other machines.
- Installing External CA
- The subsequent installation of an external CA consists of multiple steps:
- Start the installation:
[root@ipa-server ~] ipa-ca-install --external-ca
After this step an information is shown that a certificate signing request (CSR) was saved. Submit the CSR to the external CA and copy the issued certificate to the IdM server. - Continue the installation with passing the certificates and full path to the external CA files to
ipa-ca-install:[root@ipa-server ~]# ipa-ca-install --external-cert-file=/root/master.crt --external-cert-file=/root/ca.crt
- Run the
ipa-certupdateutility on all servers and clients to update them with the information about the new certificate from LDAP. You must runipa-certupdateon every server and client separately.Important
Always runipa-certupdateafter manually installing a certificate. If you do not, the certificate will not be distributed to the other machines.
26.9. Replacing the Web Server's and LDAP Server's Certificate
- Request a new certificate. You can do this using:
- the integrated CA: see Section 24.1.1, “Requesting New Certificates for a User, Host, or Service” for details.
- an external CA: generate a private key and certificate signing request (CSR). For example, using OpenSSL:
$ openssl req -new -newkey rsa:2048 -days 365 -nodes -keyout new.key -out new.csr -subj '/CN=idmserver.idm.example.com,O=IDM.EXAMPLE.COM'
Submit the CSR to the external CA. The process differs depending on the service to be used as the external CA.
- Replace the Apache web server's private key and certificate:
[root@ipaserver ~]# ipa-server-certinstall -w --pin=password new.key new.crt
- Replace the LDAP server's private key and certificate:
[root@ipaserver ~]# ipa-server-certinstall -d --pin=password new.key new.cert
Chapter 27. Kerberos PKINIT Authentication in IdM
27.1. Default PKINIT Status in Different IdM Versions
Table 27.1. Default PKINIT configuration in IdM versions
| RHEL version | CA configuration | PKINIT configuration |
|---|---|---|
| 7.3 and earlier | Without a CA | Local PKINIT: IdM only uses PKINIT for internal purposes on servers. |
| 7.3 and earlier | With an integrated CA |
IdM attempts to configure PKINIT by using the certificate signed by the integrated IdM CA.
If the attempt fails, IdM configures local PKINIT only.
|
| 7.4 and later |
Without a CA
No external PKINIT certificate provided to IdM
| Local PKINIT: IdM only uses PKINIT for internal purposes on servers. |
| 7.4 and later |
Without a CA
External PKINIT certificate provided to IdM
| IdM configures PKINIT by using the external Kerberos key distribution center (KDC) certificate and CA certificate. |
| 7.4 and later | With an integrated CA | IdM configures PKINIT by using the certificate signed by the IdM CA. |
27.2. Displaying the Current PKINIT Configuration
ipa pkinit-status command:
$ ipa pkinit-status
Server name: server1.example.com
PKINIT status: enabled
[...output truncated...]
Server name: server2.example.com
PKINIT status: disabled
[...output truncated...]ipa-pkinit-manage status command:
# ipa-pkinit-manage status
PKINIT is enabled
The ipa-pkinit-manage command was successfulenabled or disabled:
enabled: PKINIT is configured using a certificate signed by the integrated IdM CA or an external PKINIT certificate. See also Section 27.1, “Default PKINIT Status in Different IdM Versions”.disabled: IdM only uses PKINIT for internal purposes on IdM servers.
ipa config-show command on any server:
$ ipa config-show
Maximum username length: 32
Home directory base: /home
Default shell: /bin/sh
Default users group: ipausers
[...output truncated...]
IPA masters capable of PKINIT: server1.example.com
[...output truncated...]Additional Resources
- For more details on the command-line tools for reporting the PKINIT status, use the
ipa help pkinitcommand.
27.3. Configuring PKINIT in IdM
--no-pkinit option with the ipa-server-install or ipa-replica-install utilities.
Prerequisites
- Ensure that all IdM servers with a certificate authority (CA) installed are running on the same domain level. See Chapter 7, Displaying and Raising the Domain Level for details.
Procedure
- If you are using IdM without a CA, use the
ipa-server-certinstallutility to install an external Kerberos key distribution center (KDC) certificate. The KDC certificate must meet the following conditions:- It is issued with the common name
CN=fully_qualified_domain_name,certificate_subject_base. - It includes the Kerberos principal
krbtgt/REALM_NAME@REALM_NAME. - It contains the object identifier (OID) for KDC authentication:
1.3.6.1.5.2.3.5.
#
ipa-server-certinstall --kdc kdc.pem#systemctl restart krb5kdc.serviceFor details, see the ipa-server-certinstall(1) man page. - Enable PKINIT:
$
ipa-pkinit-manage enableConfiguring Kerberos KDC (krb5kdc) [1/1]: installing X509 Certificate for PKINIT Done configuring Kerberos KDC (krb5kdc). The ipa-pkinit-manage command was successfulIf you are using an IdM CA, the command requests a PKINIT KDC certificate from the CA. - To verify the new PKINIT status, see Section 27.2, “Displaying the Current PKINIT Configuration”.
27.4. Additional Resources
- For details on Kerberos PKINIT, PKINIT configuration in the MIT Kerberos Documentation.
- For documentation on configuring PKINIT smart-card authentication in IdM, see Section 23.5, “PKINIT Smart-card Authentication in Identity Management”.
Part VI. Administration: Managing Policies
Chapter 28. Defining Password Policies
28.1. What Are Password Policies and Why Are They Useful
28.2. How Password Policies Work in IdM
Note
28.2.1. Supported Password Policy Attributes
Table 28.1. Password Policy Attributes
| Attribute | Explanation | Example |
|---|---|---|
| Max lifetime | The maximum amount of time (in days) that a password is valid before a user must reset it. |
Max lifetime = 90
User passwords are valid only for 90 days. After that, IdM prompts users to change them.
|
| Min lifetime | The minimum amount of time (in hours) that must pass between two password change operations. |
Min lifetime = 1
After users change their passwords, they must wait at least 1 hour before changing them again.
|
| History size |
How many previous passwords are stored. A user cannot reuse a password from their password history.
|
History size = 0
Users can reuse any of their previous passwords.
|
| Character classes | The number of different character classes the user must use in the password. The character classes are:
Using a character three or more times in a row decreases the character class by one. For example:
|
Character classes = 0
The default number of classes required is 0. To configure the number, run the
ipa pwpolicy-mod command with the --minclasses option. This command sets the required number of character classes to 1:
$ ipa pwpolicy-mod --minclasses=1See also the Important note below this table. |
| Min length | The minimum number of characters in a password. |
Min length = 8
Users cannot use passwords shorter than 8 characters.
|
| Max failures | The maximum number of failed login attempts before IdM locks the user account. See also Section 22.1.3, “Unlocking User Accounts After Password Failures”. |
Max failures = 6
IdM locks the user account the user enters a wrong password 7 times in a row.
|
| Failure reset interval | The amount of time (in seconds) after which IdM resets the current number of failed login attempts. |
Failure reset interval = 60
If the user waits for more than 1 minute after the number of failed login attempts defined in
Max failures, the user can attempt to log in again without risking a user account lock.
|
| Lockout duration | The amount of time (in seconds) for which the user account is locked after the number of failed login attempts defined in Max failures. See also Section 22.1.3, “Unlocking User Accounts After Password Failures”. |
Lockout duration = 600
Users with locked accounts are unable to log in for 10 minutes.
|
Important
28.2.2. Global and Group-specific Password Policies
- Global password policy
- Installing the initial IdM server automatically creates a global password policy with default settings.The global policy rules apply to all users without a group password policy.
- Group password policies
- Group password policies apply to all members of the corresponding user group.
28.2.3. Password Policy Priorities
0.
- If multiple password policies are applicable to a user, the policy with the lowest priority value takes precedence. All rules defined in other policies are ignored.
- The password policy with the lowest priority value applies to all password policy attributes, even the attributes that are not defined in the policy.
Table 28.2. Example of Applying Password Policy Attributes Based on Priority
| Max lifetime | Min length | |
|---|---|---|
| Policy for group A (priority 0) | 60 | 10 |
| Policy for group B (priority 1) | 90 | 0 (no restriction) |
| ↓ | ↓ | |
| User (member of group A and group B) | 60 | 10 |
Note
ipa pwpolicy-show --user=user_name command shows which policy is currently in effect for a particular user.
28.3. Adding a New Password Policy
- a user group to which the policy will apply (see Section 28.2.2, “Global and Group-specific Password Policies”)
- a priority (see Section 28.2.3, “Password Policy Priorities”)
- the web UI, see the section called “Web UI: Adding a New Password Policy”
- the command line, see the section called “Command Line: Adding a New Password Policy”
Web UI: Adding a New Password Policy
- Select → .
- Click .
- Define the user group and priority.
- Click to confirm.
Command Line: Adding a New Password Policy
- Use the
ipa pwpolicy-addcommand. Specify the user group and priority:$
ipa pwpolicy-addGroup:group_namePriority:priority_level - Optional. Use the
ipa pwpolicy-findcommand to verify that the policy has been successfully added:$
ipa pwpolicy-find
28.4. Modifying Password Policy Attributes
Important
Note
- the web UI, see the section called “Web UI: Modifying a Password Policy”
- the command line, see the section called “Command Line: Modifying a Password Policy”
0 means no attribute restriction. For example, if you set maximum lifetime to 0, user passwords never expire.
Web UI: Modifying a Password Policy
- Select → .
- Click the policy you want to change.
- Update the required attributes. For details on the available attributes, see Section 28.2.1, “Supported Password Policy Attributes”.
- Click to confirm the changes.
Command Line: Modifying a Password Policy
- Use the
ipa pwpolicy-modcommand to change the policy's attributes.- For example, to update the global password policy and set the minimum password length to
10:$
ipa pwpolicy-mod --minlength=10 - To update a group policy, add the group name to
ipa pwpolicy-mod. For example:$
ipa pwpolicy-mod group_name --minlength=10
- Optional. Use the
ipa pwpolicy-showcommand to display the new policy settings.- To display the global policy:
$
ipa pwpolicy-show - To display a group policy, add the group name to
ipa pwpolicy-show:$
ipa pwpolicy-show group_name
28.5. Changing Password Expiration Date with Immediate Effect
krbPasswordExpiration attribute value in LDAP. For example, for a single user:
- Use the
ldapmodifyutility:#
ldapmodify -D "cn=Directory Manager" -w secret -h server.example.com -p 389 -vvdn:uid=user_name,cn=users,cn=accounts,dc=example,dc=comchangetype:modifyreplace:krbPasswordExpirationkrbPasswordExpiration:20160203203734ZThekrbPasswordExpirationformat follows this template:- Year (
2016) - Month (
02) - Day (
03) - Current time in hours, minutes, and seconds (
20:37:34) - Time zone (
Z)
- Press Ctrl+D to confirm and send the changes to the server.
-f option with ldapmodify to reference an LDIF file.
Chapter 29. Managing the Kerberos Domain
Important
kadmin or kadmin.local utilities to manage the Identity Management Kerberos policies. Use the native Identity Management command-line tools as described in this guide.
29.1. Managing Kerberos Ticket Policies
29.1.1. Determining the lifetime of a Kerberos Ticket
kinit command and the ticket_lifetime setting in the /etc/krb5.conf file. The value is then sent to the Identity Management server where server-side evaluation takes place. If the requested lifetime is lower than what the global settings allow, the requested lifetime is granted. Otherwise, the lifetime granted is the value which the global settings allow.
On the client side
- If you explicitly state a value for user_name in the
kinitcommand itself by using the-loption, for example:$ kinit user_name -l 90000
that value, in this case 90000 seconds, is requested by the client on behalf of user_name. - Else, if no lifetime value is passed in as an argument of the
kinit user_namecommand, the value of theticket_lifetimesetting in the client’s/etc/krb5.conffile is used by the client on behalf of user_name. If no value is specified in the/etc/krb5.conffile, the default IdM value for initial ticket requests is used, which is 1 day.
On the server side
- The value requested by the client is compared to the
--maxlifesetting of the user_name-specific Kerberos ticket policies if these policies exist, and the lower value of the two is selected. If user_name-specific Kerberos ticket policies do not exist, the value sent by the client is compared to the--maxlifesetting of the Global Kerberos ticket policy, and the lower value of the two is selected. For details on global and user-specific Kerberos ticket policies, see Section 29.1.2, “Global and User-specific Kerberos Ticket Policies”. - The value selected in the previous step is compared to two other values:
- The value of the
max_lifesetting in the/var/kerberos/krb5kdc/kdc.conffile - The value set in the
krbMaxTicketLifeattribute of the LDAP entry with the distinguished name (DN):krbPrincipalName=krbtgt/REALM_NAME@REALM_NAME,cn=REALM_NAME,cn=kerberos,domain_name
The lowest of the three values is ultimately selected for the lifetime of the Kerberos ticket granted to user_name.
29.1.2. Global and User-specific Kerberos Ticket Policies
- Global Kerberos ticket policy
- The global policy applies to all tickets issued within the Identity Management Kerberos realm.
- User-specific Kerberos ticket policies
- User-specific policies apply only to the associated user account. For example, a user-specific Kerberos ticket policy can define a longer maximum ticket lifetime for the
adminuser.User-specific policies take precedence over the global policy.
29.1.3. Configuring the Global Kerberos Ticket Policy
- the Identity Management web UI: see the section called “Web UI: Configuring the Global Kerberos Ticket Policy”
- the command line: see the section called “Command Line: Configuring the Global Kerberos Ticket Policy”
Table 29.1. Supported Kerberos Ticket Policy Attributes
| Attribute | Explanation | Example |
|---|---|---|
| Max renew |
The period of time (in seconds) during which the user can renew the Kerberos ticket after its expiry. After the renew period, the user must log in using the
kinit utility to get a new ticket.
To renew the ticket, use the
kinit -R command.
|
Max renew = 604800
After the ticket expires, the user can renew it within the next 7 days (604,800 seconds).
|
| Max life | The lifetime of a Kerberos ticket (in seconds). The period during which the Kerberos ticket stays active. |
Max life = 86400
The ticket expires 24 hours (86,400 seconds) after it was issued.
|
Web UI: Configuring the Global Kerberos Ticket Policy
- Select → .
- Define the required values:
- In the Max renew field, enter the maximum renewal period of Kerberos tickets.
- In the Max life field, enter the maximum lifetime of Kerberos tickets.

Figure 29.1. Configuring the Global Kerberos Ticket Policy
- Click .
Command Line: Configuring the Global Kerberos Ticket Policy
- Use the
ipa krbtpolicy-modcommand, and pass at least one of the following options:--maxrenewto define the maximum renewal period of Kerberos tickets--maxlifeto define the maximum lifetime of Kerberos tickets
For example, to change the maximum lifetime:$
ipa krbtpolicy-mod --maxlife=80000Max life: 80000 Max renew: 604800
- Use the
ipa krbtpolicy-resetcommand. - Optional. Use the
ipa krbtpolicy-showcommand to verify the current settings.
ipa krbtpolicy-mod and ipa krbtpolicy-reset, pass the --help option with them.
29.1.4. Configuring User-specific Kerberos Ticket Policies
- Use the
ipa krbtpolicy-mod user_namecommand, and pass at least one of the following options:--maxrenewto define the maximum renewal period of Kerberos tickets--maxlifeto define the maximum lifetime of Kerberos tickets
If you define only one of the attributes, Identity Management will apply the global Kerberos ticket policy value for the other attribute.For example, to change the maximum lifetime for theadminuser:$
ipa krbtpolicy-mod admin --maxlife=160000Max life: 80000 Max renew: 604800 - Optional. Use the
ipa krbtpolicy-show user_namecommand to display the current values for the specified user.
kinit utility.
ipa krbtpolicy-reset user_name command. The command clears the values defined specifically to the user, after which Identity Management applies the global policy values.
ipa krbtpolicy-mod and ipa krbtpolicy-reset, pass the --help option with them.
29.2. Rekeying Kerberos Principals
- Find all keytabs issued within the required time period. For example, the following commands use the
ldapsearchutility to display all host and service principals created between midnight on January 1, 2016, and 11:59 PM on December 31, 2016 in Greenwich Mean Time (GMT):#
ldapsearch -x -b "cn=computers,cn=accounts,dc=example,dc=com" "(&(krblastpwdchange>=20160101000000)(krblastpwdchange<=20161231235959))" dn krbprincipalname#
ldapsearch -x -b "cn=services,cn=accounts,dc=example,dc=com" "(&(krblastpwdchange>=20160101000000)(krblastpwdchange<=20161231235959))" dn krbprincipalname- The searchbase (
-b) defines the subtree whereldapsearchlooks for the principals:- Host principals are stored under the
cn=computers,cn=accounts,dc=example,dc=comsubtree. - Service principals are stored under the
cn=services,cn=accounts,dc=example,dc=comsubtree.
- The
krblastpwdchangeparameter filters the search results by the last change date. The parameter accepts the YYYYMMDD format for the date and the HHMMSS format for the time of day in GMT. - Specifying the
dnandkrbprincipalnameattributes limits the search results to the entry name and principal.
- For every service and host that requires rekeying the principal, use the
ipa-getkeytabutility to retrieve a new keytab entry. Pass the following options:--principal(-p) to specify the principal--keytab(-k) to specify the location of the original keytab--server(-s) to specify the Identity Management server host name
For example:- To rekey a host principal with its keytab in the default location of
/etc/krb5.keytab:#
ipa-getkeytab -p host/client.example.com@EXAMPLE.COM -s server.example.com -k /etc/krb5.keytab - To rekey the keytab for the Apache service in the default location of
/etc/httpd/conf/ipa.keytab:#
ipa-getkeytab -p HTTP/client.example.com@EXAMPLE.COM -s server.example.com -k /etc/httpd/conf/ipa.keytabImportant
Some services, such as NFS version 4, support only a limited set of encryption types. Pass the appropriate arguments to theipa-getkeytabcommand to configure the keytab properly.
- Optional. Verify that you rekeyed the principals successfully. Use the
klistutility to list all Kerberos tickets. For example, to list all keytab entries in/etc/krb5.keytab:#
klist -kt /etc/krb5.keytabKeytab: WRFILE:/etc/krb5.keytab KVNO Timestamp Principal ---- ----------------- -------------------------------------------------------- 1 06/09/16 05:58:47 host/client.example.com@EXAMPLE.COM(aes256-cts-hmac-sha1-96) 2 06/09/16 11:23:01 host/client.example.com@EXAMPLE.COM(aes256-cts-hmac-sha1-96) 1 03/09/16 13:57:16 krbtgt/EXAMPLE.COM@EXAMPLE.COM(aes256-cts-hmac-sha1-96) 1 03/09/16 13:57:16 HTTP/server.example.com@EXAMPLE.COM(aes256-cts-hmac-sha1-96) 1 03/09/16 13:57:16 ldap/server.example.com@EXAMPLE.COM(aes256-cts-hmac-sha1-96)The output shows that the keytab entry forclient.example.comwas rekeyed with a higher KVNO. The original keytab still exists in the database with the previous KVNO.Tickets issued against the earlier keytab continue to work, while new tickets are issued using the key with the highest KVNO. This avoids any disruption to system operations.
29.3. Protecting Keytabs
/etc/httpd/conf/ipa.keytab:
- Set the owner of the file to
apache.#
chown apache /etc/httpd/conf/ipa.keytab - Set the permissions for the file to
0600. This grants read, write, and execute permissions to the owner.#
chmod 0600 /etc/httpd/conf/ipa.keytab
29.4. Removing Keytabs
ipa-rmkeytab utility, and pass these options:
--realm(-r) to specify the Kerberos realm--keytab(-k) to specify the path to the keytab file
# ipa-rmkeytab --realm EXAMPLE.COM --keytab /etc/krb5.keytab--principal (-p) option to specify the service principal:
# ipa-rmkeytab --principal ldap/client.example.com --keytab /etc/krb5.keytabChapter 30. Using sudo
sudo policies across the IdM domain. Every system in the IdM domain can be configured as a sudo client.
30.1. The sudo Utility in Identity Management
sudo utility gives administrative access to specified users. When trusted users precede an administrative command with sudo, they are prompted for their own password. Then, when they have been authenticated and assuming that the command is permitted, the administrative command is executed as if they were the root user. For more information about sudo, see the System Administrator's Guide.
30.1.1. The Identity Management LDAP Schema for sudo
sudo entries. The schema supports:
- Host groups as well as netgroups. Note that
sudoonly supports netgroups. sudocommand groups, which contain multiple commands.
Note
sudo does not support host groups or command groups, IdM translates the IdM sudo configuration into the native sudo configuration when the sudo rules are created. For example, IdM creates a corresponding shadow netgroup for every host group, which allows the IdM administrator to create sudo rules that reference host groups, while the local sudo command uses the corresponding netgroup.
sudo information is not available anonymously over LDAP. Therefore, IdM defines a default sudo user at uid=sudo,cn=sysaccounts,cn=etc,$SUFFIX. You can change this user in the LDAP sudo configuration file at /etc/sudo-ldap.conf.
30.1.2. NIS Domain Name Requirements
sudo to work properly. The sudo configuration requires NIS-formatted netgroups and a NIS domain name for netgroups. However, IdM does not require the NIS domain to actually exist. It is also not required to have a NIS server installed.
Note
ipa-client-install utility sets a NIS domain name automatically to the IdM domain name by default.
30.2. sudo Rules in Identity Management
sudo rules, you can define who can do what, where, and as whom.
- Who are the users allowed to use
sudo. - What are the commands that can be used with
sudo. - Where are the target hosts on which the users are allowed to use
sudo. - As whom is the system or other user identity which the users assume to perform tasks.
30.2.1. External Users and Hosts in sudo Rules
sudo rules. External entities are entities that are stored outside of the IdM domain, such as users or hosts that are not part of the IdM domain.
sudo rules to grant root access to a member of the IT group in IdM, where the root user is not a user defined in the IdM domain. Or, for another example, administrators can block access to certain hosts that are on a network but are not part of the IdM domain.
30.2.2. User Group Support for sudo Rules
sudo to give access to whole user groups in IdM. IdM supports both Unix and non-POSIX groups. Note that creating non-POSIX groups can cause access problems because any users in a non-POSIX group inherit non-POSIX permissions from the group.
30.2.3. Support for sudoers Options
sudoers options. For a complete list of the available sudoers options, see the sudoers(5) man page.
sudoers options. Therefore, instead of supplying multiple options in a comma-separated list, add them separately. For example, to add two sudoers options from the command line:
$ ipa sudorule-add-option sudo_rule_name Sudo Option: first_option $ ipa sudorule-add-option sudo_rule_name Sudo Option: second_option
$ ipa sudorule-add-option sudo_rule_name Sudo Option: env_keep="COLORS DISPLAY EDITOR HOSTNAME HISTSIZE INPUTRC KDEDIR LESSSECURE LS_COLORS MAIL PATH PS1 PS2 XAUTHORITY"
30.3. Configuring the Location for Looking up sudo Policies
sudo configuration makes the sudo policies defined in IdM globally available to all domain hosts. On Red Hat Enterprise Linux 7.1 systems and later, the ipa-server-install and ipa-client-install utilities automatically configure the system to use the IdM-defined policies by setting SSSD as the data provider for sudo.
sudo policies is defined on the sudoers line of the /etc/nsswitch.conf file. On IdM systems running Red Hat Enterprise Linux 7.1 and later, the default sudoers configuration in nsswitch.conf is:
sudoers: files sss
files option specifies that the system uses the sudo configuration defined in the /etc/sudoers local SSSD configuration file. The sss option specifies that the sudo configuration defined in IdM is used.
30.3.1. Configuring Hosts to Use IdM sudo Policies in Earlier Versions of IdM
sudo policies on IdM systems running Red Hat Enterprise Linux versions earlier than 7.1, configure the local machines manually. You can do this using SSSD or LDAP. Red Hat strongly recommends to use the SSSD-based configuration.
30.3.1.1. Applying the sudo Policies to Hosts Using SSSD
sudo rules:
- Configure
sudoto look to SSSD for thesudoersfile.# vim /etc/nsswitch.conf sudoers: files sss
Leaving thefilesoption in place allowssudoto check its local configuration before checking SSSD for the IdM configuration. - Add
sudoto the list of services managed by the local SSSD client.# vim /etc/sssd/sssd.conf [sssd] config_file_version = 2 services = nss, pam,
sudodomains = IPADOMAIN - Set a name for the NIS domain in the
sudoconfiguration.sudouses NIS-style netgroups, so the NIS domain name must be set in the system configuration forsudoto be able to find the host groups used in the IdMsudoconfiguration.- Enable the
rhel-domainnameservice if it is not already enabled to ensure that the NIS domain name will be persistent across reboots.# systemctl enable rhel-domainname.service
- Set the NIS domain name to use with the
sudorules.# nisdomainname example.com
- Configure the system authentication settings to persist the NIS domain name. For example:
# echo "NISDOMAIN=example.com" >> /etc/sysconfig/network
This updates the/etc/sysconfig/networkand/etc/yp.conffiles with the NIS domain.
- Optionally, enable debugging in SSSD to show what LDAP settings it is using.
[domain/IPADOMAIN] debug_level = 6 ....
The LDAP search base used by SSSD for operations is recorded in thesssd_DOMAINNAME.loglog.
30.3.1.2. Applying the sudo Policies to Hosts Using LDAP
Important
sudo Policies to Hosts Using SSSD”.
sudo policies using LDAP, see the Identity Management Guide for Red Hat Enterprise Linux 6.
30.4. Adding sudo Commands, Command Groups, and Rules
30.4.1. Adding sudo Commands
Adding sudo Commands in the Web UI
- Under the Policy tab, click → .
- Click at the top of the list.
- Fill out the information about the command. Enter the full system path to the command executable.

Figure 30.1. Adding a New
sudoCommand - Click . Alternatively, click to start adding another entry or to start editing the new entry.
Adding sudo Commands from the Command Line
sudo command, use the ipa sudocmd-add command. Provide the full system path to the command executable. For example, to add the /usr/bin/less command and a description:
$ ipa sudocmd-add /usr/bin/less --desc="For reading log files" ---------------------------------- Added sudo command "/usr/bin/less" ---------------------------------- sudo Command: /usr/bin/less Description: For reading log files
30.4.2. Adding sudo Command Groups
Adding sudo Command Groups in the Web UI
- Under the Policy tab, click → .
- Click at the top of the list.
- Fill out the information about the command group.

Figure 30.2. Adding a New
sudoCommand Group - Click to start editing the command group.
- Under the Sudo Commands tab, click to add a
sudocommand to the group. Select the required commands and move them to the Prospective column using the button.
Figure 30.3. Adding Commands to a
sudoCommand Group - Click .
Adding sudo Command Groups from the Command Line
- Create the command group using the
ipa sudocmdgroup-addcommand. For example, to create thefilescommand group and add its description:$ ipa sudocmdgroup-add files --desc="File editing commands" ----------------------------------- Added sudo command group "files" ----------------------------------- sudo Command Group: files Description: File editing commands
- Include a
sudocommand in the group using theipa sudocmdgroup-add-membercommand. Note that you can only include commands that have already been added to IdM, as described in Section 30.4.1, “AddingsudoCommands”.$ ipa sudocmdgroup-add-member files --sudocmds "/usr/bin/vim" sudo Command Group: files Description: File editing commands Member sudo commands: /usr/bin/vim ------------------------- Number of members added 1 -------------------------
30.4.3. Adding sudo Rules
Adding sudo Rules in the Web UI
- Under the Policy tab, click → .
- Click at the top of the list.
- Enter the name for the rule.

Figure 30.4. Naming a New
sudoRule - Click . Alternatively, click to start adding another entry or to start editing the new entry.
sudo rule, see Section 30.6, “Modifying sudo Rules”.
Adding sudo Rules from the Command Line
sudo rule, use the ipa sudorule-add command. For example, to add a rule named files-commands:
$ ipa sudorule-add files-commands -------------------------------- Added Sudo Rule "files-commands" -------------------------------- Rule name: files-commands Enabled: TRUE
ipa sudorule-add and the options it accepts, run the command with the --help option added.
sudo rule, see Section 30.6, “Modifying sudo Rules”.
sudo rule and editing it from the command line, see Example 30.1, “Adding and Modifying a New sudo Rule from the Command Line”.
30.5. Modifying sudo Commands and Command Groups
Modifying sudo Commands and Command Groups in the Web UI
- Under the Policy tab, click → or → .
- Click the name of the command or command group to display its configuration page.
- Change the settings as required. On some configuration pages, the button is available at the top of the page. On these pages, you must click the button to confirm the changes.
Modifying sudo Commands and Command Groups from the Command Line
ipa sudocmd-modipa sudocmdgroup-mod
sudo command or command group attributes. For example, to add a new description for the /usr/bin/less command:
$ ipa sudocmd-mod /usr/bin/less --desc="For reading log files" ------------------------------------- Modified Sudo Command "/usr/bin/less" ------------------------------------- Sudo Command: /usr/bin/less Description: For reading log files Sudo Command Groups: files
--help option added.
30.6. Modifying sudo Rules
Modifying sudo Rules in the Web UI
- Under the Policy tab, click → .
- Click the name of the rule to display its configuration page.
- Change the settings as required. On some configuration pages, the button is available at the top of the page. On these pages, click the button to confirm the changes.
sudo rule configuration page includes several configuration areas:
- The General area
- In this area, you can modify the rule's description and
sudo order. Thesudo orderfield accepts integers and defines the order in which IdM evaluates the rules. The rule with the highestsudo ordervalue is evaluated first. - The Options area
- In this area, you can add
sudoersoptions to the rule.- Click Add above the options list.

Figure 30.5. Adding a
sudoOption - Enter the
sudoersoption. For example, to specify thatsudowill not prompt the user to authenticate, add the!authenticateoption:
Figure 30.6. Entering a
sudoersOptionFor more information onsudoersoptions, see the sudoers(5) man page. - Click .
- The Who area
- In this area, you can select the users or user groups to which the
sudorule will be applied. These users will be entitled to usesudoas defined in the rule.To specify that all system users will be able to usesudoas defined in the rule, select Anyone.To apply the rule to specific users or groups only, select Specified Users and Groups and then follow these steps:- Click Add above the users or user groups list.

Figure 30.7. Adding Users to a
sudoRule - Select the users or user groups to add to the rule, and click the arrow button to move them to the Prospective column. To add an external user, specify the user in the External field, and then click the arrow button.

Figure 30.8. Selecting Users for a
sudoRule - Click .
- The Access This Host area
- In this area, you can select the hosts on which the
sudorule will be in effect. These are the hosts where the users will be grantedsudopermissions.To specify that the rule will be in effect on all hosts, select Anyone.To apply the rule to specific hosts or host groups only, select Specified Hosts and Groups and then follow these steps:- Click Add above the hosts list.

Figure 30.9. Adding Hosts to a
sudoRule - Select the hosts or host groups to include with the rule, and click the arrow button to move them to the Prospective column. To add an external host, specify the host in the External field, and then click the arrow button.

Figure 30.10. Selecting Hosts for a
sudoRule - Click .
- The Run Commands area
- In this area, you can select the commands to be included in the
sudorule. You can specify that users will be either allowed or denied to use specific commands.To specify that users will be allowed to use any command withsudo, select Any Command.To associate the rule with specific commands or command groups, select Specified Commands and Groups and then follow these steps:- Click one of the buttons to add a command or a command group.To specify allowed commands or command groups, use the Allow area. To specify denied commands or command groups, use the Deny area.

Figure 30.11. Adding Commands to a
sudoRule - Select the commands or command groups to include with the rule, and click the arrow button to move them to the Prospective column.

Figure 30.12. Selecting Commands for a
sudoRule - Click .
- The As Whom area
- In this area, you can configure the
sudorule to run the given commands as a specific, non-root user.Note that if you add a group of RunAs users, UIDs of the members of the group will be used to run the command. If you add a RunAs group, the GID of the group will be used to run the command.To specify that the rule will be run as any user on the system, select Anyone. To specify that the rule will be run as any group on the system, select Any Group.- Click Add above the users list.

Figure 30.13. Configuring
sudoRules to Execute Commands as a Specific User - Select the required users or groups, and use the arrow button to move them to the Prospective column. To add an external entity, specify it in the External field, and then click the arrow button.

Figure 30.14. Selecting Users for the Command
- Click .
Modifying sudo Rules from the Command Line
sudo rule areas:
- General
sudorules management - To change the general configuration for a
sudorule, use theipa sudorule-modcommand. The most common options accepted by the command are:- The
--descoption to change thesudorule description. For example:$ ipa sudorule-mod sudo_rule_name --desc="sudo_rule_description"
- The
--orderoption to define the order of the specified rule. For example:$ ipa sudorule-mod sudo_rule_name --order=3
- Options to specify a category of entities:
--usercat(user category),--hostcat(host category),--cmdcat(command category),--runasusercat(run-as user category), and--runasgroupcat(run-as group category). These options only accept theallvalue that associates the rule with all users, hosts, commands, run-as users, or run-as groups.For example, to specify that all users will be able to usesudoas defined in thesudo_rulerule:$ ipa sudorule-mod sudo_rule --usercat=all
Note that if the rule is already associated with a specific entity, you must remove it before defining the correspondingallcategory. For example, ifsudo_rulewas previously associated with a specific user using theipa sudorule-add-usercommand, you must first use theipa sudorule-remove-usercommand to remove the user.
For more details and a complete list of options accepted byipa sudorule-mod, run the command with the--helpoption added. - Managing
sudooptions - To add a
sudoersoption, use theipa sudorule-add-optioncommand.For example, to specify that users usingsudobased on thefiles-commandsrule will not be required to authenticate, add the!authenticateoption:$ ipa sudorule-add-option files-commands Sudo Option: !authenticate --------------------------------------------------------- Added option "!authenticate" to Sudo Rule "files-commands" ---------------------------------------------------------
For more information onsudoersoptions, see the sudoers(5) man page.To remove asudoersoption, use theipa sudorule-remove-optioncommand. For example:$ ipa sudorule-remove-option files-commands Sudo Option: authenticate ------------------------------------------------------------- Removed option "authenticate" from Sudo Rule "files-commands" -------------------------------------------------------------
- Managing who is granted the permission to use
sudo - To specify an individual user, add the
--usersoption to theipa sudorule-add-usercommand. To specify a user group, add the--groupsoption toipa sudorule-add-user.For example, to adduseranduser_groupto thefiles-commandsrule:$ ipa sudorule-add-user files-commands --users=user --groups=user_group ... ------------------------- Number of members added 2 -------------------------
To remove an individual user or group, use theipa sudorule-remove-user. For example, to remove a user:$ ipa sudorule-remove-user files-commands [member user]: user [member group]: ... --------------------------- Number of members removed 1 ---------------------------
- Managing where the users are granted the
sudopermissions - To specify a host, add the
--hostsoption to theipa sudorule-add-hostcommand. To specify a host group, add the--hostgroupsoption toipa sudorule-add-host.For example, to addexample.comandhost_groupto thefiles-commandsrule:$ ipa sudorule-add-host files-commands --hosts=example.com --hostgroups=host_group ... ------------------------- Number of members added 2 -------------------------
To remove a host or host group, use theipa sudorule-remove-hostcommand. For example:$ ipa sudorule-remove-host files-commands [member host]: example.com [member host group]: ... --------------------------- Number of members removed 1 ---------------------------
- Managing what commands can be used with
sudo - You can specify that users will be either allowed or denied to use specific commands.To specify an allowed command or command group, add the
--sudocmdsor--sudocmdgroupsoption to theipa sudorule-add-allow-command. To specify a denied command or command group, add the--sudocmdsor--sudocmdgroupsoption to theipa sudorule-add-deny-commandcommand.For example, to add the/usr/bin/lesscommand and thefilescommand group as allowed to thefiles-commandsrule:$ ipa sudorule-add-allow-command files-commands --sudocmds=/usr/bin/less --sudocmdgroups=files ... ------------------------- Number of members added 2 -------------------------
To remove a command or command group from a rule, use theipa sudorule-remove-allow-commandoripa sudorule-remove-deny-commandcommands. For example:$ ipa sudorule-remove-allow-command files-commands [member sudo command]: /usr/bin/less [member sudo command group]: ... --------------------------- Number of members removed 1 ---------------------------
Note that the--sudocmdsoption only accepts commands added to IdM, as described in Section 30.4.1, “AddingsudoCommands”. - Managing as whom the
sudocommands are run - To use the UIDs of an individual user or users in a group as the identity under which the commands are run, use the
--usersor--groupsoptions with theipa sudorule-add-runasusercommand.To use the GID of a user group as the identity for the commands, use theipa sudorule-add-runasgroup --groupscommand.If you specify no user or group,sudocommands will be run as root.For example, to specify that the identity ofuserwill be used to execute the commands in thesudorule:$ ipa sudorule-add-runasuser files-commands --users=user ... RunAs Users: user ...
ipa sudorule-* commands, see the output of the ipa help sudorule command or run a particular command with the --help option added.
Example 30.1. Adding and Modifying a New sudo Rule from the Command Line
sudo with any command on selected servers:
- Obtain a Kerberos ticket for the
adminuser or any other user allowed to managesudorules.$ kinit admin Password for admin@EXAMPLE.COM:
- Add a new
sudorule to IdM.$ ipa sudorule-add new_sudo_rule --desc="Rule for user_group" --------------------------------- Added Sudo Rule "new_sudo_rule" --------------------------------- Rule name: new_sudo_rule Description: Rule for user_group Enabled: TRUE
- Define the who: specify the group of users who will be entitled to use the
sudorule.$ ipa sudorule-add-user new_sudo_rule --groups=user_group Rule name: new_sudo_rule Description: Rule for user_group Enabled: TRUE User Groups: user_group ------------------------- Number of members added 1 -------------------------
- Define the where: specify the group of hosts where the users will be granted the
sudopermissions.$ ipa sudorule-add-host new_sudo_rule --hostgroups=host_group Rule name: new_sudo_rule Description: Rule for user_group Enabled: TRUE User Groups: user_group Host Groups: host_group ------------------------- Number of members added 1 -------------------------
- Define the what: to allow the users to run any
sudocommand, add theallcommand category to the rule.$ ipa sudorule-mod new_sudo_rule --cmdcat=all ------------------------------ Modified Sudo Rule "new_sudo_rule" ------------------------------ Rule name: new_sudo_rule Description: Rule for user_group Enabled: TRUE Command category: all User Groups: user_group Host Groups: host_group
- To let the
sudocommands be executed as root, do not specify any run-as users or groups. - Add the
!authenticatesudoersoption to specify that the users will not be required to authenticate when using thesudocommand.$ ipa sudorule-add-option new_sudo_rule Sudo Option: !authenticate ----------------------------------------------------- Added option "!authenticate" to Sudo Rule "new_sudo_rule" ----------------------------------------------------- Rule name: new_sudo_rule Description: Rule for user_group Enabled: TRUE Command category: all User Groups: user_group Host Groups: host_group Sudo Option: !authenticate
- Display the new
sudorule configuration to verify it is correct.$ ipa sudorule-show new_sudo_rule Rule name: new_sudo_rule Description: Rule for user_group Enabled: TRUE Command category: all User Groups: user_group Host Groups: host_group Sudo Option: !authenticate
30.7. Listing and Displaying sudo Commands, Command Groups, and Rules
Listing and Displaying sudo Commands, Command Groups, and Rules in the Web UI
- Under the Policy tab, click Sudo and select Sudo Rules, Sudo Commands, or Sudo Command Groups.
- Click the name of the rule, command, or command group to display its configuration page.
Listing and Displaying sudo Commands, Command Groups, and Rules from the Command Line
ipa sudocmd-findipa sudocmdgroup-findipa sudorule-find
ipa sudocmd-showipa sudocmdgroup-showipa sudorule-show
/usr/bin/less command:
$ ipa sudocmd-show /usr/bin/less Sudo Command: /usr/bin/less Description: For reading log files. Sudo Command Groups: files
--help option added.
30.8. Disabling and Enabling sudo Rules
sudo rule temporarily deactivates it. A disabled rule is not removed from IdM and can be enabled again.
Disabling and Enabling sudo Rules from the Web UI
- Under the Policy tab, click → .
- Select the rule to disable and click or .

Figure 30.15. Disabling or Enabling a
sudoRule
Disabling and Enabling sudo Rules from the Command Line
ipa sudo-rule-disable command.
$ ipa sudorule-disable sudo_rule_name ----------------------------------- Disabled Sudo Rule "sudo_rule_name" -----------------------------------
ipa sudorule-enable command.
$ ipa sudorule-enable sudo_rule_name ----------------------------------- Enabled Sudo Rule "sudo_rule_name" -----------------------------------
30.9. Removing sudo Commands, Command Groups, and Rules
Removing sudo Commands, Command Groups, and Rules in the Web UI
- Under the Policy tab, click Sudo and select Sudo Rules, Sudo Commands, or Sudo Command Groups.
- Select the command, command group, or rule to delete, and click .

Figure 30.16. Deleting a
sudoCommand
Removing sudo Commands, Command Groups, and Rules from the Command Line
ipa sudocmd-delipa sudocmdgroup-delipa sudorule-del
--help option added.
Chapter 31. Configuring Host-Based Access Control
31.1. How Host-Based Access Control Works in IdM
- Limit access to a specified system in your domain to members of a specific user group.
- Allow only a specific service to be used to access the systems in your domain.
allow_all, which allows universal access in the whole IdM domain.
Applying HBAC Rules to Groups

Figure 31.1. Host Groups and Host-Based Access Control
31.2. Configuring Host-based Access Control in an IdM Domain
Important
Do not disable theallow_allrule before creating custom HBAC rules. If you do this, no users will be able to access any hosts.
31.2.1. Creating HBAC Rules
- the IdM web UI (see the section called “Web UI: Creating an HBAC Rule”)
- the command line (see the section called “Command Line: Creating HBAC Rules”)
Web UI: Creating an HBAC Rule
- Select → → .
- Click to start adding a new rule.
- Enter a name for the rule, and click to go directly to the HBAC rule configuration page.
- In the Who area, specify the target users.
- To apply the HBAC rule to specified users or groups only, select Specified Users and Groups. Then click to add the users or groups.
- To apply the HBAC rule to all users, select Anyone.

Figure 31.2. Specifying a Target User for an HBAC Rule
- In the Accessing area, specify the target hosts:
- To apply the HBAC rule to specified hosts or groups only, select Specified Hosts and Groups. Then click to add the hosts or groups.
- To apply the HBAC rule to all hosts, select Any Host.
- In the Via Service area, specify the target HBAC services:
- To apply the HBAC rule to specified services or groups only, select Specified Services and Groups. Then click to add the services or groups.
- To apply the HBAC rule to all services, select Any Service.
Note
Only the most common services and service groups are configured for HBAC rules by default.- To display the list of services that are currently available, select → → .
- To display the list of service groups that are currently available, select → → .
To add more services and service groups, see Section 31.3, “Adding HBAC Service Entries for Custom HBAC Services” and Section 31.4, “Adding HBAC Service Groups”. - Changing certain settings on the HBAC rule configuration page highlights the button at the top of the page. If this happens, click the button to confirm the changes.
Command Line: Creating HBAC Rules
- Use the
ipa hbacrule-addcommand to add the rule.$ ipa hbacrule-addRule name:rule_name--------------------------- Added HBAC rule "rule_name" --------------------------- Rule name: rule_name Enabled: TRUE - Specify the target users.
- To apply the HBAC rule to specified users or groups only, use the
ipa hbacrule-add-usercommand.For example, to add a group:$ ipa hbacrule-add-userRule name:rule_name[member user]: [member group]:group_nameRule name: rule_name Enabled: TRUE User Groups: group_name ------------------------- Number of members added 1 -------------------------To add multiple users or groups, use the--usersand--groupsoptions:$ ipa hbacrule-add-user rule_name --users=user1 --users=user2 --users=user3Rule name: rule_name Enabled: TRUE Users: user1, user2, user3 ------------------------- Number of members added 3 ------------------------- - To apply the HBAC rule to all users, use the
ipa hbacrule-modcommand and specify thealluser category:$ ipa hbacrule-mod rule_name --usercat=all------------------------------ Modified HBAC rule "rule_name" ------------------------------ Rule name: rule_name User category: all Enabled: TRUENote
If the HBAC rule is associated with individual users or groups,ipa hbacrule-mod --usercat=allfails. In this situation, remove the users and groups using theipa hbacrule-remove-usercommand.For details, runipa hbacrule-remove-userwith the--helpoption.
- Specify the target hosts.
- To apply the HBAC rule to specified hosts or groups only, use the
ipa hbacrule-add-hostcommand.For example, to add a single host:$ ipa hbacrule-add-hostRule name:rule_name[member host]:host.example.com[member host group]: Rule name: rule_name Enabled: TRUE Hosts: host.example.com ------------------------- Number of members added 1 -------------------------To add multiple hosts or groups, use the--hostsand--hostgroupsoptions:$ ipa hbacrule-add-host rule_name --hosts=host1 --hosts=host2 --hosts=host3Rule name: rule_name Enabled: TRUE Hosts: host1, host2, host3 ------------------------- Number of members added 3 ------------------------- - To apply the HBAC rule to all hosts, use the
ipa hbacrule-modcommand and specify theallhost category:$ ipa hbacrule-mod rule_name --hostcat=all------------------------------ Modified HBAC rule "rule_name" ------------------------------ Rule name: rule_name Host category: all Enabled: TRUENote
If the HBAC rule is associated with individual hosts or groups,ipa hbacrule-mod --hostcat=allfails. In this situation, remove the hosts and groups using theipa hbacrule-remove-hostcommand.For details, runipa hbacrule-remove-hostwith the--helpoption.
- Specify the target HBAC services.
- To apply the HBAC rule to specified services or groups only, use the
ipa hbacrule-add-servicecommand.For example, to add a single service:$ ipa hbacrule-add-serviceRule name:rule_name[member HBAC service]:ftp[member HBAC service group]: Rule name: rule_name Enabled: TRUE Services: ftp ------------------------- Number of members added 1 -------------------------To add multiple services or groups, you can use the--hbacsvcsand--hbacsvcgroupsoptions:$ ipa hbacrule-add-service rule_name --hbacsvcs=su --hbacsvcs=sudoRule name: rule_name Enabled: TRUE Services: su, sudo ------------------------- Number of members added 2 -------------------------Note
Only the most common services and service groups are configured for HBAC rules. To add more, see Section 31.3, “Adding HBAC Service Entries for Custom HBAC Services” and Section 31.4, “Adding HBAC Service Groups”. - To apply the HBAC rule to all services, use the
ipa hbacrule-modcommand and specify theallservice category:$ ipa hbacrule-mod rule_name --servicecat=all------------------------------ Modified HBAC rule "rule_name" ------------------------------ Rule name: rule_name Service category: all Enabled: TRUENote
If the HBAC rule is associated with individual services or groups,ipa hbacrule-mod --servicecat=allfails. In this situation, remove the services and groups using theipa hbacrule-remove-servicecommand.For details, runipa hbacrule-remove-servicewith the--helpoption.
- Optional. Verify that the HBAC rule has been added correctly.
- Use the
ipa hbacrule-findcommand to verify that the HBAC rule has been added to IdM. - Use the
ipa hbacrule-showcommand to verify the properties of the HBAC rule.
For details, run the commands with the--helpoption.
Examples of HBAC Rules
Example 31.1. Granting a Single User Access to All Hosts Using Any Service
admin user to access all systems in the domain using any service, create a new HBAC rule and set:
- the user to
admin - the host to Any host (in the web UI), or use
--hostcat=allwithipa hbacrule-add(when adding the rule) oripa hbacrule-mod - the service to Any service (in the web UI), or use
--servicecat=allwithipa hbacrule-add(when adding the rule) oripa hbacrule-mod
Example 31.2. Ensuring That Only Specific Services Can Be Used to Access a Host
sudo-related services to access the host named host.example.com, create a new HBAC rule and set:
- the user to Anyone (in the web UI), or use
--usercat=allwithipa hbacrule-add(when adding the rule) oripa hbacrule-mod - the host to
host.example.com - the HBAC service group to
Sudo, which is a default group forsudoand related services
31.2.2. Testing HBAC Rules
Important
- the IdM web UI (see the section called “Web UI: Testing an HBAC Rule”)
- the command line (see the section called “Command Line: Testing an HBAC Rule”)
Web UI: Testing an HBAC Rule
- Select → → .
- On the Who screen: Specify the user under whose identity you want to perform the test, and click .

Figure 31.3. Specifying the Target User for an HBAC Test
- On the Accessing screen: Specify the host that the user will attempt to access, and click .
- On the Via Service screen: Specify the service that the user will attempt to use, and click .
- On the Rules screen: Select the HBAC rules you want to test, and click . If you do not select any rule, all rules will be tested.Select Include Enabled to run the test on all rules whose status is
Enabled. Select Include Disabled to run the test on all rules whose status isDisabled. To view and change the status of HBAC rules, select → → .Important
If the test runs on multiple rules, it will pass successfully if at least one of the selected rules allows access. - On the Run Test screen: Click .

Figure 31.4. Running an HBAC Test
- Review the test results:
- If you see
ACCESS DENIED, the user was not granted access in the test. - If you see
ACCESS GRANTED, the user was able to access the host successfully.

Figure 31.5. Reviewing HBAC Test Results
By default, IdM lists all the tested HBAC rules when displaying the test results.- Select Matched to display the rules that allowed successful access.
- Select Unmatched to display the rules that prevented access.
Command Line: Testing an HBAC Rule
ipa hbactest command and specify at least:
- the user under whose identity you want to perform the test
- the host that the user will attempt to access
- the service that the user will attempt to use
$ ipa hbactest
User name: user1
Target host: example.com
Service: sudo
---------------------
Access granted: False
---------------------
Not matched rules: rule1enabled. To specify different HBAC rules:
- Use the
--rulesoption to define one or more HBAC rules. - Use the
--disabledoption to test all HBAC rules whose status isdisabled.
ipa hbacrule-find command.
Example 31.3. Testing an HBAC Rule from the Command Line
rule2 prevented user1 from accessing example.com using the sudo service:
$ ipa hbactest --user=user1 --host=example.com --service=sudo --rules=rule1
---------------------
Access granted: False
---------------------
Not matched rules: rule1Example 31.4. Testing Multiple HBAC Rules from the Command Line
$ ipa hbactest --user=user1 --host=example.com --service=sudo --rules=rule1 --rules=rule2
--------------------
Access granted: True
--------------------
Matched rules: rule2
Not matched rules: rule1Matched ruleslist the rules that allowed successful access.Not matched ruleslist the rules that prevented access.
31.2.3. Disabling HBAC Rules
Note
allow_all HBAC rule, you must disable allow_all.
- the IdM web UI (see the section called “Web UI: Disabling an HBAC Rule”)
- the command line (see the section called “Command Line: Disabling an HBAC Rule”)
Web UI: Disabling an HBAC Rule
- Select → → .
- Select the HBAC rule you want to disable, and click .

Figure 31.6. Disabling the allow_all HBAC Rule
Command Line: Disabling an HBAC Rule
ipa hbacrule-disable command. For example, to disable the allow_all rule:
$ ipa hbacrule-disable allow_all
------------------------------
Disabled HBAC rule "allow_all"
------------------------------31.3. Adding HBAC Service Entries for Custom HBAC Services
Note
- the IdM web UI (see the section called “Web UI: Adding an HBAC Service Entry”)
- the command line (see the section called “Command Line: Adding an HBAC Service Entry”)
Web UI: Adding an HBAC Service Entry
- Select → → .
- Click to add an HBAC service entry.
- Enter a name for the service, and click .
Command Line: Adding an HBAC Service Entry
ipa hbacsvc-add command. For example, to add an entry for the tftp service:
$ ipa hbacsvc-add tftp
-------------------------
Added HBAC service "tftp"
-------------------------
Service name: tftp31.4. Adding HBAC Service Groups
- the IdM web UI (see the section called “Web UI: Adding an HBAC Service Group”)
- the command line (see the section called “Command Line: Adding an HBAC Service Group”)
Web UI: Adding an HBAC Service Group
- Select → → .
- Click to add an HBAC service group.
- Enter a name for the service group, and click .
- On the service group configuration page, click to add an HBAC service as a member of the group.

Figure 31.7. Adding HBAC Services to an HBAC Service Group
Command Line: Adding an HBAC Service Group
- Use the
ipa hbacsvcgroup-addcommand to add an HBAC service group. For example, to add a group namedlogin:$ ipa hbacsvcgroup-addService group name:login-------------------------------- Added HBAC service group "login" -------------------------------- Service group name: login - Use the
ipa hbacsvcgroup-add-membercommand to add an HBAC service as a member of the group. For example, to add thesshdservice to thelogingroup:$ ipa hbacsvcgroup-add-memberService group name:login[member HBAC service]:sshdService group name: login Member HBAC service: sshd ------------------------- Number of members added 1 -------------------------
Chapter 32. Defining SELinux User Maps
32.1. About Identity Management, SELinux, and Mapping Users
[root@server1 ~]# semanage user -l
Labelling MLS/ MLS/
SELinux User Prefix MCS Level MCS Range SELinux Roles
guest_u user s0 s0 guest_r
root user s0 s0-s0:c0.c1023 staff_r sysadm_r system_r unconfined_r
staff_u user s0 s0-s0:c0.c1023 staff_r sysadm_r system_r unconfined_r
sysadm_u user s0 s0-s0:c0.c1023 sysadm_r
system_u user s0 s0-s0:c0.c1023 system_r unconfined_r
unconfined_u user s0 s0-s0:c0.c1023 system_r unconfined_r
user_u user s0 s0 user_r
xguest_u user s0 s0 xguest_r
- Remote users can be granted appropriate SELinux user contexts based on their IdM group assignments. This also allows administrators to consistently apply the same policies to the same users without having to create local accounts or reconfigure SELinux.
- The SELinux context associated with a user is centralized.
- SELinux policies can be planned and related to domain-wide security policies through settings like IdM host-based access control rules.
- Administrators gain environment-wide visibility and control over how users and systems are assigned in SELinux.
- unconfined_u (also used as a default for IdM users)
- guest_u
- xguest_u
- user_u
- staff_u
Note
pam_selinux module. When a remote user attempts to log into a machine, SSSD checks its IdM identity provider to collect the user information, including any SELinux maps. The PAM module then processes the user and assigns it the appropriate SELinux user context. SSSD caching enables the mapping to work offline.
32.2. Configuring SELinux User Map Order and Defaults
SELinux_user:MLS[:MCS]
unconfined_u, the default SELinux user for system users on Red Hat Enterprise Linux.
32.2.1. In the Web UI
- In the top menu, click the IPA Server main tab and the Configuration subtab.
- Scroll to the bottom of the list of server configuration areas, to SELINUX OPTIONS.
- Edit the SELinux user configuration, the SELinux user map order, the Default SELinux user, or both.

- Click the Update link at the top of the page to save the changes.
32.2.2. In the CLI
[user1]@server ~]$ ipa config-show ... SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023 Default SELinux user: unconfined_u:s0-s0:c0.c1023
config-mod command:
Example 32.1. List of SELinux Users
--ipaselinuxusermaporder option. The list orders the SELinux users from the most to the least confined, for example:
[user1@server ~]$ ipa config-mod --ipaselinuxusermaporder="unconfined_u:s0-s0:c0.c1023$guest_u:s0$xguest_u:s0$user_u:s0-s0:c0.c1023$staff_u:s0-s0:c0.c1023"
Note
Example 32.2. Default SELinux User
--ipaselinuxusermapdefault option. For example:
[user1@server ~]$ ipa config-mod --ipaselinuxusermapdefault="guest_u:s0"
32.3. Mapping SELinux Users and IdM Users
32.3.1. In the Web UI
- In the top menu, click the Policy main tab and the SELinux User Mappings subtab.
- In the list of mappings, click the button to create a new map.

- Enter the name for the map and the SELinux user. The format of the SELinux user has to be identical with how it appears in the IdM server configuration. SELinux users have the format SELinux_user:MLS[:MCS].

- Click to add the IdM user information.
- To set a host-based access control rule, select the rule from the drop-down menu in the General area of the configuration. Using a host-based access control rule also introduces access controls on what hosts a remote user can use to access a target machine. Only one host-based access control rule can be assigned.
Note
The host-based access control rule must contain users and hosts, not just services.
Alternatively, scroll down the Users and Hosts areas, and click the Add link to assign users, user groups, hosts, or host groups to the SELinux map.
Select the users (or hosts or groups) on the left, click the right arrows button () to move them to the Prospective column, and click the button to add them to the rule.
Note
Only one option can be used: either a host-based access control rule can be given or the users and hosts can be set manually. Both options cannot be used at the same time. - Click the Update link at the top to save the changes to the SELinux user map.
32.3.2. In the CLI
- The SELinux user:
--selinuxuser - The user or user groups which are associated with the SELinux user:
--usersor--groups - The host or host groups which are associated with the SELinux user:
--hostsor--hostgroups - Alternatively, a host-based access control rule which specifies both hosts and users in it:
--hbacrule
selinuxusermap-add command. Users and hosts can be added to a rule after it is created by using the selinuxusermap-add-user and selinuxusermap-add-host commands, respectively.
Example 32.3. Creating a New SELinux Map
--selinuxuser value must be the SELinux user name exactly as it appears in the IdM server configuration. SELinux users have the format SELinux_user:MLS[:MCS].
[user1@server ~]$ ipa selinuxusermap-add --selinuxuser="xguest_u:s0" selinux1 [user1@server ~]$ ipa selinuxusermap-add-user --users=user1 --users=user2 --users=user3 selinux1 [user1@server ~]$ ipa selinuxusermap-add-host --hosts=server.example.com --hosts=test.example.com selinux1
Example 32.4. Creating an SELinux Map with a Host-Based Access Control Rule
--hbacrule value identifies the host-based access control rule to use for mapping. Using a host-based access control rule introduces access controls on what hosts a remote user can use to access a target machine, along with applying SELinux contexts after the remote user has logged into the target machine.
[user1@server ~]$ ipa selinuxusermap-add --hbacrule=webserver --selinuxuser="xguest_u:s0" selinux1
Example 32.5. Adding a User to an SELinux Map
selinuxusermap-add-user or selinuxusermap-add-host.
[user1@server ~]$ ipa selinuxusermap-add-user --users=user1 selinux1
selinuxusermap-mod command is used with the --hbacrule option to modify an already existing SELinux map, the new SELinux map overwrites the previous SELinux map.
Example 32.6. Removing a User from an SELinux Map
selinuxusermap-remove-host or selinuxusermap-remove-user command. For example:
[user1@server ~]$ ipa selinuxusermap-remove-user --users=user2 selinux1
Part VII. Administration: Managing Network Services
Chapter 33. Managing DNS
33.1. BIND in Identity Management
Note
chroot environment.
bind-dyndb-ldap plug-in. IdM creates a dynamic-db configuration section in the /etc/named.conf file for the BIND service, which configures the bind-dyndb-ldap plug-in for the BIND named-pkcs11 service.
client1.example.com. domain name contains three A records and one AAAA record:
dn: idnsname=client1,idnsname=example.com.,cn=dns,dc=idm,dc=example,dc=com objectclass: top objectclass: idnsrecord idnsname: client1 Arecord: 192.0.2.1 Arecord: 192.0.2.2 Arecord: 192.0.2.3 AAAArecord: 2001:DB8::ABCD
Important
33.2. Supported DNS Zone Types
Note
- Master DNS zones
- Master DNS zones contain authoritative DNS data and can accept dynamic DNS updates. This behavior is equivalent to the
type mastersetting in standard BIND configuration. Master zones are managed using theipa dnszone-*commands.In compliance with standard DNS rules, every master zone must contain SOA and NS records. IdM generates these records automatically when the DNS zone is created, but the NS records must be manually copied to the parent zone to create proper delegation.In accordance with standard BIND behavior, forwarding configuration specified for master zones only affects queries for names for which the server is not authoritative.Example 33.1. Example Scenario for DNS Forwarding
The IdM server contains thetest.example.master zone. This zone contains an NS delegation record for thesub.test.example.name. In addition, thetest.example.zone is configured with the192.0.2.254forwarder IP address.A client querying the namenonexistent.test.example.receives theNXDomainanswer, and no forwarding occurs because the IdM server is authoritative for this name.On the other hand, querying for thesub.test.example.name is forwarded to the configured forwarder192.0.2.254because the IdM server is not authoritative for this name. - Forward DNS zones
- Forward DNS zones do not contain any authoritative data. All queries for names belonging to a forward DNS zone are forwarded to a specified forwarder. This behavior is equivalent to the
type forwardsetting in standard BIND configuration. Forward zones are managed using theipa dnsforwardzone-*commands.
33.3. DNS Configuration Priorities
- Zone-specific configuration
- The level of configuration specific for a particular zone defined in IdM has the highest priority. Zone-specific configuration is managed using the
ipa dnszone-*andipa dnsforwardzone-*commands. - Global DNS configuration
- If no zone-specific configuration is defined, IdM uses global DNS configuration stored in LDAP. Global DNS configuration is managed using the
ipa dnsconfig-*commands. Settings defined in global DNS configuration are applied to all IdM DNS servers. - Configuration in
/etc/named.conf - Configuration defined in the
/etc/named.conffile on each IdM DNS server has the lowest priority. It is specific for each server and must be edited manually.The/etc/named.conffile is usually only used to specify DNS forwarding to a local DNS cache; other options are managed using the commands for zone-specific and global DNS configuration mentioned above.
33.4. Managing Master DNS Zones
33.4.1. Adding and Removing Master DNS Zones
Adding Master DNS Zones in the Web UI
- Open the Network Services tab, and select the DNS subtab, followed by the DNS Zones section.

Figure 33.1. Managing DNS Master Zones
- To add a new master zone, click at the top of the list of all zones.

Figure 33.2. Adding a Master DNS Zone
- Provide the zone name, and click .

Figure 33.3. Entering a New Master Zone
Adding Master DNS Zones from the Command Line
ipa dnszone-add command adds a new zone to the DNS domain. Adding a new zone requires you to specify the name of the new subdomain. You can pass the subdomain name directly with the command:
$ ipa dnszone-add newserver.example.com
ipa dnszone-add, the script prompts for it automatically.
ipa dnszone-add command also accepts various command-line options. For a complete list of these options, run the ipa dnszone-add --help command.
Removing Master DNS Zones

Figure 33.4. Removing a Master DNS Zone
ipa dnszone-del command. For example:
$ ipa dnszone-del server.example.com
33.4.2. Adding Additional Configuration for Master DNS Zones
DNS Zone Configuration Attributes
Table 33.1. Zone Attributes
| Attribute | Command-Line Option | Description |
|---|---|---|
| Authoritative name server | --name-server |
Sets the domain name of the master DNS name server, also known as SOA MNAME.
By default, each IdM server advertises itself in the SOA MNAME field. Consequently, the value stored in LDAP using
--name-server is ignored.
|
| Administrator e-mail address | --admin-email | Sets the email address to use for the zone administrator. This defaults to the root account on the host. |
| SOA serial | --serial | Sets a serial number in the SOA record. Note that IdM sets the version number automatically and users are not expected to modify it. |
| SOA refresh | --refresh | Sets the interval, in seconds, for a secondary DNS server to wait before requesting updates from the primary DNS server. |
| SOA retry | --retry | Sets the time, in seconds, to wait before retrying a failed refresh operation. |
| SOA expire | --expire | Sets the time, in seconds, that a secondary DNS server will try to perform a refresh update before ending the operation attempt. |
| SOA minimum | --minimum | Sets the time to live (TTL) value in seconds for negative caching according to RFC 2308. |
| SOA time to live | --ttl | Sets TTL in seconds for records at zone apex. In zone example.com, for instance, all records (A, NS, or SOA) under name example.com are configured, but no other domain names, like test.example.com, are affected. |
| Default time to live | --default-ttl | Sets the default time to live (TTL) value in seconds for negative caching for all values in a zone that never had an individual TTL value set before. Requires a restart of the named-pkcs11 service on all IdM DNS servers after changes to take effect. |
| BIND update policy | --update-policy |
Sets the permissions allowed to clients in the DNS zone.
See Dynamic Update Policies in the BIND 9 Administrator Reference Manual for more information on update policy syntax.
|
| Dynamic update | --dynamic-update=TRUE|FALSE | Enables dynamic updates to DNS records for clients.
Note that if this is set to false, IdM client machines will not be able to add or update their IP address. See Section 33.5.1, “Enabling Dynamic DNS Updates” for more information.
|
| Allow transfer | --allow-transfer=string |
Gives a list of IP addresses or network names which are allowed to transfer the given zone, separated by semicolons (;).
Zone transfers are disabled by default. The default
--allow-transfer value is none.
|
| Allow query | --allow-query | Gives a list of IP addresses or network names which are allowed to issue DNS queries, separated by semicolons (;). |
| Allow PTR sync | --allow-sync-ptr=1|0 | Sets whether A or AAAA records (forward records) for the zone will be automatically synchronized with the PTR (reverse) records. |
| Zone forwarders | --forwarder=IP_address | Specifies a forwarder specifically configured for the DNS zone. This is separate from any global forwarders used in the IdM domain.
To specify multiple forwarders, use the option multiple times.
|
| Forward policy | --forward-policy=none|only|first | Specifies the forward policy. For information about the supported policies, see the section called “Forward Policies” |
Editing the Zone Configuration in the Web UI

Figure 33.5. DNS Master Zones Management
- Click on the zone name in the list of all zones to open the DNS zone page.

Figure 33.6. Editing a Master Zone
- Click Settings, and then change the zone configuration as required.

Figure 33.7. The Settings Tab in the Master Zone Edit Page
For information about the available settings, see Table 33.1, “Zone Attributes”. - Click to confirm the new configuration.
Note
named-pkcs11 service on all IdM DNS servers to make the changes take effect. All other settings are automatically activated immediately.
Editing the Zone Configuration from the Command Line
ipa dnszone-mod command. For information about the available settings, see Table 33.1, “Zone Attributes”.
ipa dnszone-mod command adds the attribute. If the attribute exists, the command overwrites the current value with the specified value.
ipa dnszone-mod and its options, run the ipa dnszone-mod --help command.
Note
named-pkcs11 service on all IdM DNS servers to make the changes take effect. All other settings are automatically activated immediately.
33.4.3. Enabling Zone Transfers
Important
Enabling Zone Transfers in the UI

Figure 33.8. Enabling Zone Transfers
Enabling Zone Transfers from the Command Line
--allow-transfer option to the ipa dnszone-mod command. Specify the list of name servers to which the zone records will be transferred using --allow-transfer. For example:
[user@server ~]$ ipa dnszone-mod --allow-transfer=192.0.2.1;198.51.100.1;203.0.113.1 example.com
bind service, IdM DNS zones can be transferred, by name, by clients such as the dig utility:
[root@server ~]# dig @ipa-server zone_name AXFR
33.4.4. Adding Records to DNS Zones
- A
- This is a basic map for a host name and an ordinary IPv4 address. The record name of an A record is a host name, such as
www. The IP Address value of an A record is a standard IPv4 address, such as192.0.2.1.For more information about A records, see RFC 1035. - AAAA
- This is a basic map for a host name and an IPv6 address. The record name of an AAAA record is a host name, such as
www. The IP Address value is a standard hexadecimal IPv6 address, such as2001:DB8::1111.For more information about AAAA records, see RFC 3596. - SRV
- Service (SRV) resource records map service names to the DNS name of the server that is providing that particular service. For example, this record type can map a service like an LDAP directory to the server which manages it.The record name of an SRV record has the format
_service._protocol, such as_ldap._tcp. The configuration options for SRV records include priority, weight, port number, and host name for the target service.For more information about SRV records, see RFC 2782. - PTR
- A pointer record type (PTR) record adds a reverse DNS record, which maps an IP address to a domain name.
Note
All reverse DNS lookups for IPv4 addresses use reverse entries that are defined in thein-addr.arpa.domain. The reverse address, in human-readable form, is the exact reverse of the regular IP address, with thein-addr.arpa.domain appended to it. For example, for the network address192.0.2.0/24, the reverse zone is2.0.192.in-addr.arpa.The record name of a PTR record must be in the standard format specified in RFC 1035, extended in RFC 2317, and RFC 3596. The host name value must be a canonical host name of the host for which you want to create the record. For more information, see Example 33.8, “PTR Record”.Note
Reverse zones can also be configured for IPv6 addresses, with zones in the.ip6.arpa.domain. For more information about IPv6 reverse zones, see RFC 3596.
DNS Wildcard Support
* in a DNS zone as wildcard.
Example 33.2. Demonstrating DNS Wildcard Results
- Configure the following in your DNS zone example.com:
- A wildcard A record
*.example.com. - An MX record for
mail.example.com, but no A record for this host. - No record for
demo.example.com.
- Query existing and non-existent DNS records and types. You will receive the following results:
# host -t MX mail.example.com. mail.example.com mail is handled by 10 server.example.com. # host -t MX demo.example.com. demo.example.com. has no MX record. # host -t A mail.example.com. mail.example.com has no A record # host -t A demo.example.com. random.example.com has address 192.168.1.1
Adding DNS Resource Records from the Web UI
- Open the DNS zone page, as described in the section called “Editing the Zone Configuration in the Web UI”.
- In the DNS Resource Records section, click to add a new record.

Figure 33.9. Adding a New DNS Resource Record
- Select the type of record to create and fill out the other fields as required.

Figure 33.10. Defining a New DNS Resource Record
- Click to confirm the new record.
Adding DNS Resource Records from the Command Line
ipa dnsrecord-add command. The command follows this syntax:
$ ipa dnsrecord-add zone_name record_name --record_type_option=data
ipa dnsrecord-add Options” lists options for the most common resource record types: A (IPv4), AAAA (IPv6), SRV, and PTR. Lists of entries can be set by using the option multiple times with the same command invocation or, in Bash, by listing the options in a comma-separated list inside curly braces, such as --option={val1,val2,val3}.
ipa dnsrecord-add and which DNS record types are supported by IdM, run the ipa dnsrecord-add --help command.
Table 33.2. Common ipa dnsrecord-add Options
| General Record Options | |
|---|---|
| Option | Description |
--ttl=number | Sets the time to live for the record. |
--structured | Parses the raw DNS records and returns them in a structured format. |
| "A" Record Options | |
|---|---|
| Option | Description |
--a-rec=ARECORD | Passes a list of A records. |
--a-ip-address=string | Gives the IP address for the record. |
| "AAAA" Record Options | |
|---|---|
| Option | Description |
--aaaa-rec=AAAARECORD | Passes a list of AAAA (IPv6) records. |
--aaaa-ip-address=string | Gives the IPv6 address for the record. |
| "PTR" Record Options | |
|---|---|
| Option | Description |
--ptr-rec=PTRRECORD | Passes a list of PTR records. |
--ptr-hostname=string | Gives the host name for the record. |
| "SRV" Record Options | |
|---|---|
| Option | Description |
--srv-rec=SRVRECORD | Passes a list of SRV records. |
--srv-priority=number | Sets the priority of the record. There can be multiple SRV records for a service type. The priority (0 - 65535) sets the rank of the record; the lower the number, the higher the priority. A service has to use the record with the highest priority first. |
--srv-weight=number | Sets the weight of the record. This helps determine the order of SRV records with the same priority. The set weights should add up to 100, representing the probability (in percentages) that a particular record is used. |
--srv-port=number | Gives the port for the service on the target host. |
--srv-target=string | Gives the domain name of the target host. This can be a single period (.) if the service is not available in the domain. |
33.4.5. Examples of Adding or Modifying DNS Resource Records from the Command Line
Example 33.3. Adding a IPv4 Record
www.example.com with the IP address 192.0.2.123.
$ ipa dnsrecord-add example.com www --a-rec 192.0.2.123
Example 33.4. Adding a IPv4 Wildcard Record
192.0.2.123:
$ ipa dnsrecord-add example.com "*" --a-rec 192.0.2.123
Example 33.5. Modifying a IPv4 Record
--a-record. However, when modifying an A record, the --a-record option is used to specify the current value for the A record. The new value is set with the --a-ip-address option.
$ ipa dnsrecord-mod example.com www --a-rec 192.0.2.123 --a-ip-address 192.0.2.1
Example 33.6. Adding an IPv6 Record
www.example.com with the IP address 2001:db8::1231:5675.
$ ipa dnsrecord-add example.com www --aaaa-rec 2001:db8::1231:5675
Example 33.7. Adding an SRV Record
_ldap._tcp defines the service type and the connection protocol for the SRV record. The --srv-rec option defines the priority, weight, port, and target values.
[root@server ~]# ipa dnsrecord-add server.example.com _ldap._tcp --srv-rec="0 51 389 server1.example.com." [root@server ~]# ipa dnsrecord-add server.example.com _ldap._tcp --srv-rec="1 49 389 server2.example.com."
51 and 49 in this example) add up to 100 and represent the probability (in percentages) that a particular record is used.
Example 33.8. PTR Record
ipa dnsrecord-add command is reverse, compared to the usage for adding other DNS records:
$ ipa dnsrecord-add reverseNetworkIpAddress hostIpAddress --ptr-rec FQDN
server4.example.com with IPv4 address 192.0.2.4:
$ ipa dnsrecord-add 2.0.192.in-addr.arpa 4 --ptr-rec server4.example.com.
0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. IPv6 reverse zone for the host server2.example.com with the IP address 2001:DB8::1111:
$ ipa dnsrecord-add 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. 1.1.1.0.0.0.0.0.0.0.0.0.0.0.0 --ptr-rec server2.example.com.
33.4.6. Deleting Records from DNS Zones
Deleting Records in the Web UI
- Open the DNS zone page, as described in the section called “Editing the Zone Configuration in the Web UI”.
- In the DNS Resource Records section, click the name of the resource record.

Figure 33.11. Selecting a DNS Resource Record
- Select the check box by the name of the record type to delete.

Figure 33.12. Deleting a DNS Resource Record
After this, only the selected record type is deleted; the other configuration is left intact.
- Open the DNS zone page, as described in the section called “Editing the Zone Configuration in the Web UI”.
- In the DNS Resource Records section, select the check box by the name of the resource record to delete, and then click at the top of the list of zone records.

Figure 33.13. Deleting an Entire Resource Record
After this, the entire resource record is deleted.
Deleting Records from the Command Line
ipa dnsrecord-del command and add the --recordType-rec option together with the record value.
$ ipa dnsrecord-del example.com www --a-rec 192.0.2.1
ipa dnsrecord-del without any options, the command prompts for information about the record to delete. Note that passing the --del-all option with the command removes all associated records for the zone.
ipa dnsrecord-del and a complete list of options accepted by the command, run the ipa dnsrecord-del --help command.
33.4.7. Disabling and Enabling Zones
Disabling and Enabling Zones in the Web UI

Figure 33.14. Managing DNS Zones

Figure 33.15. Disabling a DNS Zone
Disabling and Enabling DNS Zones from the Command Line
ipa dnszone-disable command. For example:
[user@server ~]$ ipa dnszone-disable zone.example.com ----------------------------------------- Disabled DNS zone "example.com" -----------------------------------------
ipa dnszone-enable command.
33.5. Managing Dynamic DNS Updates
33.5.1. Enabling Dynamic DNS Updates
ipa-client-install script cannot add a DNS record pointing to the new client.
Note
- The DNS zone must be configured to allow dynamic updates
- The local clients must be configured to send dynamic updates
33.5.1.1. Configuring the DNS Zone to Allow Dynamic Updates
Enabling Dynamic DNS Updates in the Web UI
- Open the Network Services tab, and select the DNS subtab, followed by the DNS Zones section.

Figure 33.16. DNS Zone Management
- Click on the zone name in the list of all zones to open the DNS zone page.

Figure 33.17. Editing a Master Zone
- Click Settings to switch to the DNS zone settings tab.

Figure 33.18. The Settings Tab in the Master Zone Edit Page
- Scroll down to the Dynamic update field, and set the value to True.

Figure 33.19. Enabling Dynamic DNS Updates
- Click at the top of the page to confirm the new configuration.
Enabling Dynamic DNS Updates from the Command Line
ipa dnszone-mod command with the --dynamic-update=TRUE option. For example:
[user@server ~]$ ipa dnszone-mod server.example.com --dynamic-update=TRUE
33.5.1.2. Configuring the Clients to Send Dynamic Updates
--enable-dns-updates option with the ipa-client-install script.
[root@client ~]# ipa-client-install --enable-dns-updates
- Open the SSSD configuration file.
[root@server ~]# vim /etc/sssd/sssd.conf
- Find the domain section for the IdM domain.
[domain/ipa.example.com]
- If dynamic updates have not been enabled for the client, then set the
dyndns_updatevalue to true.dyndns_updates = true
- Add or edit the
dyndns_ttlparameter to set the value, in seconds.dyndns_ttl = 2400
33.5.2. Synchronizing A/AAAA and PTR Records
- Both forward and reverse zones must be managed by the IdM server.
- Both zones must have dynamic updates enabled.Enabling dynamic updates is covered in Section 33.5.1, “Enabling Dynamic DNS Updates”.
- PTR synchronization must be enabled for the master forward zone, not for the reverse zone.
- The PTR record will be updated only if the name of the requesting client matches the name in the PTR record.
Important
Warning
Configuring PTR Record Synchronization in the Web UI
- Open the Network Services tab, and select the DNS subtab, followed by the DNS Zones section.

Figure 33.20. DNS Zone Management
- Click on the zone name in the list of all zones to open the DNS zone page.

Figure 33.21. Editing a DNS Zone
- Click Settings to switch to the DNS zone settings tab.

Figure 33.22. The Settings Tab in the Master Zone Edit Page
- Select the Allow PTR sync check box.

Figure 33.23. Enabling PTR Synchronization
- Click at the top of the page to confirm the new configuration.
Configuring PTR Record Synchronization from the Command Line
--allow-sync-ptr option to 1 when the zone is created or when it is edited. For example, using the ipa dnszone-mod command when editing an existing zone:
[user@server ~]$ ipa dnszone-mod --allow-sync-ptr=1 zone.example.com
--allow-sync-ptr value is 0, which disables synchronization.
33.5.3. Updating DNS Dynamic Update Policies
update-policy statement in the /etc/named.conf file. For more information on dynamic update policies, see the BIND 9 documentation.
Updating DNS Update Policies in the Web UI
- Open the Network Services tab, and select the DNS subtab, followed by the DNS Zones section.

Figure 33.24. DNS Zone Management
- Click on the zone name in the list of all zones to open the DNS zone page.

Figure 33.25. Editing a DNS Zone
- Click Settings to switch to the DNS zone settings tab.

Figure 33.26. The Settings Tab in the Master Zone Edit Page
- Set the required update policies in a semi-colon separated list in the BIND update policy text box.

Figure 33.27. DNS Update Policy Settings
- Click at the top of the DNS zone page to confirm the new configuration.
Updating DNS Update Policies from the Command Line
--update-policy option and add the access control rule in a statement after the option. For example:
$ ipa dnszone-mod zone.example.com --update-policy "grant EXAMPLE.COM krb5-self * A; grant EXAMPLE.COM krb5-self * AAAA; grant EXAMPLE.COM krb5-self * SSHFP;"
33.6. Managing DNS Forwarding
- Split DNS configuration, also known as DNS views configuration, where DNS servers return different answers to different clients. Split DNS configuration is typical for environments where some DNS names are available inside the company network, but not from the outside.
- Configurations where a firewall restricts access to DNS on the Internet.
- Configurations with centralized filtering or logging on the DNS level.
- Configurations with forwarding to a local DNS cache, which helps optimize network traffic.
Forward Policies
- Forward first (default)
- DNS queries are forwarded to the configured forwarder. If a query fails because of a server error or timeout, BIND falls back to the recursive resolution using servers on the Internet. The forward first policy is the default policy. It is suitable for traffic optimization.
- Forward only
- DNS queries are forwarded to the configured forwarder. If a query fails because of a server error or timeout, BIND returns an error to the client. The forward only policy is recommended for environments with split DNS configuration.
- None: Forwarding disabled
- DNS queries are not forwarded. Disabling forwarding is only useful as a zone-specific override for global forwarding configuration. This options is the IdM equivalent of specifying an empty list of forwarders in BIND configuration.
Forwarding Does Not Combine Data from IdM and Other DNS Servers
NXDOMAIN answer is returned. Forwarding is not used.
Example 33.9. Example Scenario
test.example. DNS zone. BIND is configured to forward queries to the DNS server with the 192.0.2.254 IP address.
nonexistent.test.example. DNS name, BIND detects that the IdM server is authoritative for the test.example. zone and does not forward the query to the 192.0.2.254. server. As a result, the DNS client receives the NXDomain answer, informing the user that the queried domain does not exist.
Zone Delegation in IdM DNS Master Zone
idm.example.com, you can delegate the authority for the sub_zone1.idm.example.com subzone to a different DNS server. To achieve this behavior, you need to use forwarding, as described above, along with a nameserver record which delegates the subzone to a different DNS server. In the following example, sub_zone1 is the subzone, and 192.0.2.1 is the IP address of the DNS server the subzone is delegated to:
$ ipa dnsrecord-add idm.example.com. sub_zone1 --ns-rec=192.0.2.1
$ ipa dnsforwardzone-add sub_zone1.idm.example.com. --forwarder 192.0.2.1
33.6.1. Configuring Global Forwarders
- Using the
ipa dnsconfig-modcommand or the IdM web UI - Configuration set using these native IdM tools is immediately applied to all IdM DNS servers. As explained in Section 33.3, “DNS Configuration Priorities”, global DNS configuration has higher priority than local configuration defined in the
/etc/named.conffiles. - By editing the
/etc/named.conffile - Manually editing the
/etc/named.confon every IdM DNS server allows using a different global forwarder and policy on each of the servers. Note that the BIND service must be restarted after changing/etc/named.conf.
Configuring Forwarders in the Web UI
- Click the Network Services tab, and select the DNS subtab, followed by the DNS Global Configuration section.
- To add a new global forwarder, click and enter the IP address. To define a new forward policy, select it from the list of available policies.

Figure 33.28. Editing Global DNS Configuration in the Web UI
- Click to confirm the new configuration.
Configuring Forwarders from the Command Line
ipa dnsconfig-mod command. It edits the DNS global configuration by editing the LDAP data. The ipa dnsconfig-mod command and its options affect all IdM DNS servers at once and override any local configuration.
ipa dnsconfig-mod:
[user@server ~]$ ipa dnsconfig-mod --forwarder=192.0.2.254 Global forwarders: 192.0.2.254
33.6.2. Configuring Forward Zones
Important
/usr/share/doc/bind-version_number/ directory, or external sources [5] .
Configuring Forward Zones in the Web UI

Figure 33.29. Managing DNS Forward Zones
Configuring Forward Zones from the Command Line
ipa dnsforwardzone-* commands described below.
Note
ipa dnsforwardzone-* commands behave consistently with the ipa dnszone-* commands used to manage master zones.
ipa dnsforwardzone-* commands accept several options; notably, the --forwarder, --forward-policy, and --name-from-ip options. For detailed information about the available options, see Table 33.1, “Zone Attributes” or run the commands with the --help option added, for example:
ipa dnsforwardzone-add --help
- Adding Forward Zones
- Use the
dnsforwardzone-addcommand to add a new forward zone. It is required to specify at least one forwarder if the forward policy is not set tonone.[user@server ~]$ ipa dnsforwardzone-add zone.test. --forwarder=172.16.0.1 --forwarder=172.16.0.2 --forward-policy=first Zone name: zone.test. Zone forwarders: 172.16.0.1, 172.16.0.2 Forward policy: first
- Modifying Forward Zones
- Use the
dnsforwardzone-modcommand to modify a forward zone. It is required to specify at least one forwarder if the forward policy is notnone. Modifications can be performed in several ways.[user@server ~]$ ipa dnsforwardzone-mod zone.test. --forwarder=172.16.0.3 Zone name: zone.test. Zone forwarders: 172.16.0.3 Forward policy: first
[user@server ~]$ ipa dnsforwardzone-mod zone.test. --forward-policy=only Zone name: zone.test. Zone forwarders: 172.16.0.3 Forward policy: only
- Showing Forward Zones
- Use the
dnsforwardzone-showcommand to display information about a specified forward zone.[user@server ~]$ ipa dnsforwardzone-show zone.test. Zone name: zone.test. Zone forwarders: 172.16.0.5 Forward policy: first
- Finding Forward Zones
- Use the
dnsforwardzone-findcommand to locate a specified forward zone.[user@server ~]$ ipa dnsforwardzone-find zone.test. Zone name: zone.test. Zone forwarders: 172.16.0.3 Forward policy: first ---------------------------- Number of entries returned 1 ----------------------------
- Deleting Forward Zones
- Use the
dnsforwardzone-delcommand to delete specified forward zones.[user@server ~]$ ipa dnsforwardzone-del zone.test. ---------------------------- Deleted forward DNS zone "zone.test." ----------------------------
- Enabling and Disabling Forward Zones
- Use
dnsforwardzone-enableanddnsforwardzone-disablecommands to enable and disable forward zones. Note that forward zones are enabled by default.[user@server ~]$ ipa dnsforwardzone-enable zone.test. ---------------------------- Enabled forward DNS zone "zone.test." ----------------------------
[user@server ~]$ ipa dnsforwardzone-disable zone.test. ---------------------------- Disabled forward DNS zone "zone.test." ----------------------------
- Adding and Removing Permissions
- Use
dnsforwardzone-add-permissionanddnsforwardzone-remove-permissioncommands to add or remove system permissions.[user@server ~]$ ipa dnsforwardzone-add-permission zone.test. --------------------------------------------------------- Added system permission "Manage DNS zone zone.test." --------------------------------------------------------- Manage DNS zone zone.test.
[user@server ~]$ ipa dnsforwardzone-remove-permission zone.test. --------------------------------------------------------- Removed system permission "Manage DNS zone zone.test." --------------------------------------------------------- Manage DNS zone zone.test.
33.7. Managing Reverse DNS Zones
- By the zone name, in the format
reverse_ipv4_address.in-addr.arpaorreverse_ipv6_address.ip6.arpa.The reverse IP address is created by reversing the order of the components of the IP address. For example, if the IPv4 network is192.0.2.0/24, the reverse zone name is2.0.192.in-addr.arpa.(with the trailing period). - By the network address, in the format
network_ip_address/subnet_mask_bit_countTo create the reverse zone by its IP network, set the network information to the (forward-style) IP address, with the subnet mask bit count. The bit count must be a multiple of eight for IPv4 addresses or a multiple of four for IPv6 addresses.
Adding a Reverse DNS Zone in the Web UI
- Open the Network Services tab, and select the DNS subtab, followed by the DNS Zones section.

Figure 33.30. DNS Zone Management
- Click at the top of the list of all zones.

Figure 33.31. Adding a Reverse DNS Zone
- Fill in the zone name or the reverse zone IP network.
- For example, to add a reverse DNS zone by the zone name:

Figure 33.32. Creating a Reverse Zone by Name
- Alternatively, to add a reverse DNS zone by the reverse zone IP network:

Figure 33.33. Creating a Reverse Zone by IP Network
The validator for the Reverse zone IP network field warns you about an invalid network address during typing. The warning will disappear once you enter the full network address.
- Click to confirm the new reverse zone.
Adding a Reverse DNS Zone from the Command Line
ipa dnszone-add command.
[user@server]$ ipa dnszone-add 2.0.192.in-addr.arpa.
[user@server ~]$ ipa dnszone-add --name-from-ip=192.0.2.0/24
Other Management Operations for Reverse DNS Zones
33.8. Defining DNS Query Policy
--allow-query option with the ipa dnszone-mod command to set a list of clients which are allowed to issue queries.
[user@server ~]$ ipa dnszone-mod --allow-query=192.0.2.0/24;2001:DB8::/32;203.0.113.1 example.com
--allow-query value is any, which allows the zone to be queried by any client.
33.9. DNS Locations
33.9.1. DNS-based Service Discovery
LDAP or Kerberos. One typical type of operation is to allow clients to locate authentication servers within the closest network infrastructure, because they provide a higher throughput and lower network latency, lowering overall costs.
- No need for clients to be explicitly configured with names of nearby servers.
- DNS servers are used as central providers of policy. Clients using the same DNS server have access to the same policy about service providers and their preferred order.
Example 33.10. DNS Location Independent Results
$ dig -t SRV +short _kerberos._tcp.idm.example.com 0 100 88 idmserver-01.idm.example.com. 0 100 88 idmserver-02.idm.example.com.
0(priority): Priority of the target host. A lower value is preferred.100(weight). Specifies a relative weight for entries with the same priority. For further information, see RFC 2782, section 3.88(port number): Port number of the service.- Canonical name of the host providing the service.
germany:
Example 33.11. DNS Location-based Results
$ dig -t SRV +short _kerberos._tcp.idm.example.com _kerberos._tcp.germany._locations.idm.example.com. 0 100 88 idmserver-01.idm.example.com. 50 100 88 idmserver-02.idm.example.com.
idmserver-01.idm.example.com has the lowest priority value and is therefore preferred. The idmserver-02.idm.example.com has a higher priority and thus is used only as backup for cases when the preferred host is unavailable.
33.9.2. Deployment Considerations for DNS Locations
33.9.2.1. DNS Time to Live (TTL)
1 day.
33.9.3. Creating DNS Locations
Creating DNS Locations from the Web UI
- Open the IPA Server tab, and select Topology subtab.
- Click IPA Locations in the navigation bar.
- Click at the top of the locations list.
- Fill in the location name.
- Click the button to save the location.
Creating DNS Locations from the Command Line
germany, enter:
[root@server ~]# ipa location-add germany ---------------------------- Added IPA location "germany" ---------------------------- Location name: germany
33.9.4. Assigning an IdM Server to a DNS Location
Assigning an IdM Server to a DNS Location from the Web UI
- Open the IPA Server tab, and select Topology subtab.
- Click IPA Servers in the navigation.
- Click on the IdM server name.
- Select a DNS location, and optionally set a service weight:

Figure 33.34. Assigning a Server to a DNS Location
- Click .
- Restart the
named-pkcs11service on the host you assigned in the previous steps the DNS location to:[root@idmserver-01 ~]# systemctl restart named-pkcs11
Assigning an IdM Server to a DNS Location from the Command Line
- Optional: List all configured DNS locations:
[root@server ~]# ipa location-find ----------------------- 2 IPA locations matched ----------------------- Location name: australia Location name: germany ----------------------------- Number of entries returned: 2 -----------------------------
- Assign the server to the DNS location. For example, to assign the location
germanyto the server idmserver-01.idm.example.com, run:[root@server ~]# ipa server-mod idmserver-01.idm.example.com --location=germany ipa: WARNING: Service named-pkcs11.service requires restart on IPA server idmserver-01.idm.example.com to apply configuration changes. -------------------------------------------------- Modified IPA server "idmserver-01.idm.example.com" -------------------------------------------------- Servername: idmserver-01.idm.example.com Min domain level: 0 Max domain level: 1 Location: germany Enabled server roles: DNS server, NTP server
- Restart the
named-pkcs11service on the host you assigned in the previous steps the DNS location to:[root@idmserver-01 ~]# systemctl restart named-pkcs11
33.10. Updating DNS Records Systematically When Using External DNS
- Section 33.10.2, “GUI: Updating External DNS Records” if you use a GUI to manage the external DNS records
- Section 33.10.3, “Command Line: Updating External DNS Records Using
nsupdate” if you use thensupdateutility to manage the external DNS records
33.10.1. Updating External DNS in Identity Management
- After installing or uninstalling a replica
- After installing a CA, DNS, KRA, or Active Directory trust on an Identity Management server
33.10.2. GUI: Updating External DNS Records
- Display the records that you must update. Use the
ipa dns-update-system-records --dry-runcommand.$
ipa dns-update-system-records --dry-runIPA DNS records: _kerberos-master._tcp.example.com. 86400 IN SRV 0 100 88 ipa.example.com. _kerberos-master._udp.example.com. 86400 IN SRV 0 100 88 ipa.example.com. [... output truncated ...] - Use the external DNS GUI to update the records.
33.10.3. Command Line: Updating External DNS Records Using nsupdate
Generating a File with the DNS Records for nsupdate
- Use the
ipa dns-update-system-records --dry-runcommand with the--outoption. The option specifies the path of the file to generate:$
ipa dns-update-system-records --dry-run --out dns_records_file.nsupdateIPA DNS records: _kerberos-master._tcp.example.com. 86400 IN SRV 0 100 88 ipa.example.com. _kerberos-master._udp.example.com. 86400 IN SRV 0 100 88 ipa.example.com. [... output truncated ...]The generated file contains the required DNS records in the format accepted by thensupdateutility. - The generated records rely on:
- Automatic detection of the zone in which the records are to be updated
- Automatic detection of the zone's authoritative server
If you are using an atypical DNS setup or if zone delegations are missing,nsupdatemight not be able to find the right zone and server. In this case, add the following options to the beginning of the generated file:serverspecifies the server name or port of the authoritative DNS server to whichnsupdatesends the recordszonespecifies the zone name of the zone wherensupdateplaces the records
Example:$
cat dns_records_file.nsupdatezone example.com. server 192.0.2.1 ; IPA DNS records update delete _kerberos-master._tcp.example.com. SRV update add _kerberos-master._tcp.example.com. 86400 IN SRV 0 100 88 ipa.example.com. [... output truncated ...]
Submitting the Dynamic DNS Update Request to the Name Server
nsupdate, make sure you properly secure it. You can secure the request using these mechanisms:
- Transaction Signature (TSIG) protocol
- TSIG enables you to use
nsupdatewith a shared key. See Procedure 33.1, “Sending annsupdateRequest Secured Using TSIG”. - GSS algorithm for TSIG (GSS-TSIG)
- GSS-TSIG uses the GSS-API interface to obtain the secret TSIG key. GSS-TSIG is an extension to the TSIG protocol. See Procedure 33.2, “Sending an
nsupdateRequest Secured Using GSS-TSIG”
Procedure 33.1. Sending an nsupdate Request Secured Using TSIG
- Make sure you meet these prerequisites:
- Run
nsupdate, and provide the shared secret using one of these options:-kto provide the TSIG authentication key:$
nsupdate -k tsig_key.file dns_records_file.nsupdate-yto generate a signature from the name of the key and from the Base64-encoded shared secret:$
nsupdate -y algorithm:keyname:secret dns_records_file.nsupdate
Procedure 33.2. Sending an nsupdate Request Secured Using GSS-TSIG
- Make sure you meet these prerequisites:
- Your DNS server must be configured for GSS-TSIG. See these server configuration examples: BIND, PowerDNS, Windows DNS.
Note
This procedure assumes that Kerberos V5 protocol is used as the technology for GSS-API. - To submit the DNS update request, authenticate with a principal allowed to update the records, and run
nsupdatewith the-goption to enable the GSS-TSIG mode:$
kinit principal_allowed_to_update_records@REALM$nsupdate -g dns_records_file.nsupdate
Additional Resources
33.11. Installing DNS Services Into an Existing Server
ipa-dns-install utility.
ipa-dns-install follows the same principles as installing DNS with the ipa-server-install utility, as described in Section 2.3.3, “Installing a Server with Integrated DNS”.
ipa-dns-install, see the ipa-dns-install(1) man page.
33.11.1. Setting up Additional Name Servers
/etc/resolv.conf file. It is recommended to manually add other DNS servers as backup servers in case the IdM server becomes unavailable. For example:
search example.com ; the IdM server nameserver 192.0.2.1 ; backup DNS servers nameserver 198.51.100.1 nameserver 198.51.100.2
/etc/resolv.conf, see the resolv.conf(5) man page.
Chapter 34. Using Automount
34.1. About Automount and IdM
auto.master file in the /etc directory. If necessary, there can be multiple auto.master configuration files in separate server locations.
autofs utility is configured on a server and the server is a client in an IdM domain, then all configuration information for automount is stored in the IdM directory. Rather than in separate text files, the autofs configuration containing maps, locations, and keys are stored as LDAP entries. For example, the default map file, auto.master, is stored as:
dn: automountmapname=auto.master,cn=default,cn=automount,dc=example,dc=com objectClass: automountMap objectClass: top automountMapName: auto.master
Important
autofs deployment but does not set up or configure autofs itself.
cn=automount,dc=example,dc=com, and each map and each key are stored beneath that location.
- The
ipa automountlocation*commands for Locations, - The
ipa automountmap*commands for direct and indirect maps, - The
ipa automountkey*commands for keys.
34.2. Configuring Automount
autofs configuration. Autofs can be configured manually using LDAP or SSSD as a data store, or it can be configured automatically.
Note
/home directory can be mounted from the command line successfully. Making sure that NFS is working properly makes it easier to troubleshoot any potential IdM automount configuration errors later.
34.2.1. Configuring NFS Automatically
autofs can be configured to use the IdM domain as its NFS domain and have autofs services enabled.
ipa-client-automount utility automatically configures the NFS configuration files, /etc/sysconfig/nfs and /etc/idmapd.conf. It also configures SSSD to manage the credentials for NFS. If the ipa-client-automount command is run without any options, it runs a DNS discovery scan to identify an available IdM server and creates a default location called default.
[root@ipa-server ~]# ipa-client-automount Searching for IPA server... IPA server: DNS discovery Location: default Continue to configure the system with these values? [no]: yes Configured /etc/nsswitch.conf Configured /etc/sysconfig/nfs Configured /etc/idmapd.conf Started rpcidmapd Started rpcgssd Restarting sssd, waiting for it to become available. Started autofs
[root@server ~]# ipa-client-automount --server=ipaserver.example.com --location=boston
ipa-client-automount utility configures SSSD to cache automount maps, in case the external IdM store is ever inaccessible. Configuring SSSD does two things:
- It adds service configuration information to the SSSD configuration. The IdM domain entry is given settings for the autofs provider and the mount location.
autofs_provider = ipa ipa_automount_location = default
And NFS is added to the list of supported services (services = nss,pam,autofs...) and given a blank configuration entry ([autofs]). - The Name Service Switch (NSS) service information is updated to check SSSD first for automount information, and then the local files.
automount: sss files
ipa-client-automount command can be run with the --no-sssd option, which changes all of the required NFS configuration files, but does not change the SSSD configuration.
[root@server ~]# ipa-client-automount --no-sssd
--no-sssd is used, the list of configuration files updated by ipa-client-automount is different:
- The command updates
/etc/sysconfig/autofsinstead of/etc/sysconfig/nfs. - The command configures
/etc/autofs_ldap_auth.confwith the IdM LDAP configuration. - The command configures
/etc/nsswitch.confto use the LDAP services for automount maps.
Note
ipa-client-automount command can only be run once. If there is an error in the configuration, than the configuration files need to be edited manually.
34.2.2. Configuring autofs Manually to Use SSSD and Identity Management
- Edit the
/etc/sysconfig/autofsfile to specify the schema attributes that autofs searches for:# # Other common LDAP naming # MAP_OBJECT_CLASS="automountMap" ENTRY_OBJECT_CLASS="automount" MAP_ATTRIBUTE="automountMapName" ENTRY_ATTRIBUTE="automountKey" VALUE_ATTRIBUTE="automountInformation"
- Specify the LDAP configuration. There are two ways to do this. The simplest is to let the automount service discover the LDAP server and locations on its own:
LDAP_URI="ldap:///dc=example,dc=com"
Alternatively, explicitly set which LDAP server to use and the base DN for LDAP searches:LDAP_URI="ldap://ipa.example.com" SEARCH_BASE="cn=location,cn=automount,dc=example,dc=com"
Note
The default value for location isdefault. If additional locations are added (Section 34.4, “Configuring Locations”), then the client can be pointed to use those locations, instead. - Edit the
/etc/autofs_ldap_auth.conffile so that autofs allows client authentication with the IdM LDAP server.- Change
authrequiredto yes. - Set the principal to the Kerberos host principal for the NFS client server, host/fqdn@REALM. The principal name is used to connect to the IdM directory as part of GSS client authentication.
<autofs_ldap_sasl_conf usetls="no" tlsrequired="no" authrequired="yes" authtype="GSSAPI" clientprinc="host/server.example.com@EXAMPLE.COM" />If necessary, runklist -kto get the exact host principal information. - Configure autofs as one of the services which SSSD manages.
- Open the SSSD configuration file.
[root@server ~]# vim /etc/sssd/sssd.conf
- Add the autofs service to the list of services handled by SSSD.
[sssd] services = nss,pam,
autofs - Create a new
[autofs]section. This can be left blank; the default settings for an autofs service work with most infrastructures.[nss] [pam] [sudo]
[autofs][ssh] [pac] - Optionally, set a search base for the autofs entries. By default, this is the LDAP search base, but a subtree can be specified in the
ldap_autofs_search_baseparameter.[domain/EXAMPLE] ... ldap_search_base = "dc=example,dc=com" ldap_autofs_search_base = "ou=automount,dc=example,dc=com"
- Restart SSSD:
[root@server ~]# systemctl restart sssd.service
- Check the
/etc/nsswitch.conffile, so that SSSD is listed as a source for automount configuration:automount:
sssfiles - Restart autofs:
[root@server ~]# systemctl restart autofs.service
- Test the configuration by listing a user's
/homedirectory:[root@server ~]# ls /home/userName
If this does not mount the remote file system, check the/var/log/messagesfile for errors. If necessary, increase the debug level in the/etc/sysconfig/autofsfile by setting theLOGGINGparameter todebug.
Note
automount -f -dThis prints the debug log information directly, without having to cross-check the LDAP access log with automount's log.
34.2.3. Configuring Automount on Solaris
Note
- If the NFS server is running on Red Hat Enterprise Linux, specify on the Solaris machine that NFSv3 is the maximum supported version. Edit the
/etc/default/nfsfile and set the following parameter:NFS_CLIENT_VERSMAX=3
- Use the
ldapclientcommand to configure the host to use LDAP:ldapclient -v manual -a authenticationMethod=none -a defaultSearchBase=dc=example,dc=com -a defaultServerList=ipa.example.com -a serviceSearchDescriptor=passwd:cn=users,cn=accounts,dc=example,dc=com -a serviceSearchDescriptor=group:cn=groups,cn=compat,dc=example,dc=com -a serviceSearchDescriptor=auto_master:automountMapName=auto.master,cn=location,cn=automount,dc=example,dc=com?one -a serviceSearchDescriptor=auto_home:automountMapName=auto_home,cn=location,cn=automount,dc=example,dc=com?one -a objectClassMap=shadow:shadowAccount=posixAccount -a searchTimelimit=15 -a bindTimeLimit=5 - Enable
automount:# svcadm enable svc:/system/filesystem/autofs
- Test the configuration.
- Check the LDAP configuration:
# ldapclient -l auto_master dn: automountkey=/home,automountmapname=auto.master,cn=location,cn=automount,dc=example,dc=com objectClass: automount objectClass: top automountKey: /home automountInformation: auto.home
- List a user's
/homedirectory:# ls /home/userName
34.3. Setting up a Kerberos-aware NFS Server
Note
34.3.1. Setting up a Kerberos-aware NFS Server
- Obtain a Kerberos ticket before running IdM tools.
[jsmith@server ~]$ kinit admin
- If the NFS host machine has not been added as a client to the IdM domain, then create the host entry. See Section 12.3, “Adding Host Entries”.
- Create the NFS service entry in the IdM domain. For example:
[jsmith@server ~]$ ipa service-add nfs/nfs-server.example.com
For more information, see Section 16.1, “Adding and Editing Service Entries and Keytabs”. - Generate an NFS service keytab for the NFS server using the
ipa-getkeytabcommand, and save the keys directly to the host keytab. For example:[jsmith@server ~]$ ipa-getkeytab -s ipaserver.example.com -p nfs/nfs-server.example.com -k /etc/krb5.keytab
Note
Verify that the NFS service has been properly configured in IdM, with its keytab, by checking the service entry:[jsmith@server ~]$ ipa service-show nfs/nfs-server.example.com Principal: NFS/nfs-server.example.com@EXAMPLE.COM Keytab: True
Note
This procedure assumes that the NFS server is running on a Red Hat Enterprise Linux system or a UNIX system which can runipa-getkeytab.If the NFS server is running on a system which cannot runipa-getkeytab, then create the keytab using system tools. Two things must be done:- The key must be created in the
/root(or equivalent) directory. - The
ktutilcommand can merge the keys into the system/etc/krb5.keytabfile. The ktutil man page describes how to use the tool.
- Install the NFS packages. For example:
[root@nfs-server ~]# yum install nfs-utils
- Configure weak crypto support. This is required for every NFS client if any client (such as a Red Hat Enterprise Linux 5 client) in the domain will use older encryption options like DES.
- Edit the
krb5.conffile to allow weak crypto.[root@nfs-server ~]# vim /etc/krb5.conf allow_weak_crypto = true
- Update the IdM server Kerberos configuration to support the DES encryption type.
[jsmith@ipaserver ~]$ ldapmodify -x -D "cn=directory manager" -w password -h ipaserver.example.com -p 389 dn: cn=EXAMPLEREALM,cn=kerberos,dc=example,dc=com changetype: modify add: krbSupportedEncSaltTypes krbSupportedEncSaltTypes: des-cbc-crc:normal - add: krbSupportedEncSaltTypes krbSupportedEncSaltTypes: des-cbc-crc:special - add: krbDefaultEncSaltTypes krbDefaultEncSaltTypes: des-cbc-crc:special
- Run the
ipa-client-automountcommand to configure the NFS settings.By default, this enables secure NFS in the/etc/sysconfig/nfsfile and sets the IdM DNS domain in theDomainparameter in the/etc/idmapd.conffile. - Edit the
/etc/exportsfile and add the Kerberos information:/export *(rw,sec=krb5:krb5i:krb5p)
- Restart the NFS server and related services.
[root@nfs-server ~]# systemctl restart nfs.service [root@nfs-server ~]# systemctl restart nfs-server.service [root@nfs-server ~]# systemctl restart nfs-secure.service [root@nfs-server ~]# systemctl restart nfs-secure-server.service
- Configure the NFS server as an NFS client, following the directions in Section 34.3.2, “Setting up a Kerberos-aware NFS Client”.
34.3.2. Setting up a Kerberos-aware NFS Client
- Obtain a Kerberos ticket before running IdM tools.
[jsmith@server ~]$ kinit admin
- If the NFS client is not enrolled as a client in the IdM domain, then set up the required host entries, as described in Section 12.3, “Adding Host Entries”.
- Run the
ipa-client-automountcommand to configure the NFS settings.By default, this enables secure NFS in the/etc/sysconfig/nfsfile and sets the IdM DNS domain in theDomainparameter in the/etc/idmapd.conffile. - Start the GSS daemon.
[root@nfs-client-server ~]# systemctl start rpc-gssd.service [root@nfs-client-server ~]# systemctl start rpcbind.service [root@nfs-client-server ~]# systemctl start nfs-idmapd.service
- Mount the directory.
[root@nfs-client-server ~]# echo "$NFSSERVER:/this /mnt/this nfs4 sec=krb5i,rw,proto=tcp,port=2049" >>/etc/fstab [root@nfs-client-server ~]# mount -av
- Configure SSSD on the client system to manage home directories and renew Kerberos tickets.
- Enable SSSD with the
--enablemkhomediroption.[root@nfs-client-server ~]# authconfig --update --enablesssd --enablesssdauth --enablemkhomedir
- Restart the OpenSSH client.
[root@nfs-client-server ~]# systemctl restart sshd.service
- Edit the IdM domain section in the SSSD configuration file to set the keytab renewal options.
[root@nfs-client-server ~]# vim /etc/sssd/sssd.conf [domain/EXAMPLE.COM] cache_credentials = True krb5_store_password_if_offline = True ipa_domain = example.com id_provider = ipa auth_provider = ipa ...
krb5_renewable_lifetime = 50dkrb5_renew_interval = 3600 - Restart SSSD.
[root@nfs-client-server ~]# systemctl restart sssd.service
34.4. Configuring Locations
auto.master, and a location can store multiple maps. The location entry only works as a container for map entries; it is not an automount configuration in and of itself.
Important
34.4.1. Configuring Locations through the Web UI
- Click the Policy tab.
- Click the Automount subtab.
- Click the Add link at the top of the list of automount locations.

- Enter the name for the new location.

- Click the button to go to the map configuration for the new location. Create maps, as described in Section 34.5.1.1, “Configuring Direct Maps from the Web UI” and Section 34.5.2.1, “Configuring Indirect Maps from the Web UI”.
34.4.2. Configuring Locations through the Command Line
automountlocation-add and give the location name.
$ ipa automountlocation-add locationFor example:
$ ipa automountlocation-add raleigh ---------------------------------- Added automount location "raleigh" ---------------------------------- Location: raleigh
auto.master and auto.direct. auto.master is the root map for all automount maps for the location. auto.direct is the default map for direct mounts and is mounted on /-.
automountlocation-tofiles command:
$ ipa automountlocation-tofiles raleigh /etc/auto.master: /- /etc/auto.direct --------------------------- /etc/auto.direct:
34.5. Configuring Maps
Note
Important
34.5.1. Configuring Direct Maps
--------------------------- /etc/auto.direct: /shared/man server.example.com:/shared/man
34.5.1.1. Configuring Direct Maps from the Web UI
- Click the Policy tab.
- Click the Automount subtab.
- Click name of the automount location to which to add the map.

- In the Automount Maps tab, click the + Add link to create a new map.

- In pop-up window, select the Direct radio button and enter the name of the new map.

- In the Automount Keys tab, click the + Add link to create a new key for the map.

- Enter the mount point. The key defines the actual mount point in the key name. The Info field sets the network location of the directory, as well as any
mountoptions to use.
- Click the button to save the new key.
34.5.1.2. Configuring Direct Maps from the Command Line
auto.direct item. The simplest configuration is to define a direct mapping by adding an automount key to the existing direct map entry. It is also possible to create different direct map entries.
auto.direct file. The --key option identifies the mount point, and --info gives the network location of the directory, as well as any mount options to use. For example:
$ ipa automountkey-add raleigh auto.direct --key=/share --info="ro,soft,ipaserver.example.com:/home/share" Key: /share Mount information: ro,soft,ipaserver.example.com:/home/share
ldapclient command to add the LDAP entry directly:
ldapclient -a serviceSearchDescriptor=auto_direct:automountMapName=auto.direct,cn=location,cn=automount,dc=example,dc=com?one
34.5.2. Configuring Indirect Maps
/docs and the key is man, then the map is /docs/man.
34.5.2.1. Configuring Indirect Maps from the Web UI
- Click the Policy tab.
- Click the Automount subtab.
- Click name of the automount location to which to add the map.

- In the Automount Maps tab, click the + Add link to create a new map.

- In pop-up window, select the Indirect radio button and enter the required information for the indirect map:

- The name of the new map
- The mount point. The Mount field sets the base directory to use for all the indirect map keys.
- Optionally, a parent map. The default parent is
auto.master, but if another map exists which should be used, that can be specified in the Parent Map field.
- Click the button to save the new key.
34.5.2.2. Configuring Indirect Maps from the Command Line
--------------------------- /etc/auto.share: man ipa.example.com:/docs/man ---------------------------
- Create an indirect map to set the base entry using the
automountmap-add-indirectcommand. The--mountoption sets the base directory to use for all the indirect map keys. The default parent entry isauto.master, but if another map exists which should be used, that can be specified using the--parentmapoption.$ ipa automountmap-add-indirect location mapName --mount=directory [--parentmap=mapName]
For example:$ ipa automountmap-add-indirect raleigh auto.share --mount=/share -------------------------------- Added automount map "auto.share" --------------------------------
- Add the indirect key for the mount location:
$ ipa automountkey-add raleigh auto.share --key=docs --info="ipa.example.com:/export/docs" ------------------------- Added automount key "docs" ------------------------- Key: docs Mount information: ipa.example.com:/export/docs
- To verify the configuration, check the location file list using
automountlocation-tofiles:$ ipa automountlocation-tofiles raleigh /etc/auto.master: /- /etc/auto.direct /share /etc/auto.share --------------------------- /etc/auto.direct: --------------------------- /etc/auto.share: man ipa.example.com:/export/docs
ldapclient command to add the LDAP entry directly:
ldapclient -a serviceSearchDescriptor=auto_share:automountMapName=auto.share,cn=location,cn=automount,dc=example,dc=com?one
34.5.3. Importing Automount Maps
ipa automountlocation-import location map_file [--continuous]
--continuous option tells the automountlocation-import command to continue through the map file, even if the command encounters errors.
$ ipa automountlocation-import raleigh /etc/custom.map
Part VIII. Security Hardening
Chapter 35. Configuring TLS for Identity Management
Important
35.1. Configuring the httpd Daemon
- Open the
/etc/httpd/conf.d/nss.conffile, and set the following values for theNSSProtocolandNSSCipherSuiteentries:NSSProtocol TLSv1.2 NSSCipherSuite +ecdhe_ecdsa_aes_128_sha,+ecdhe_ecdsa_aes_256_sha,+ecdhe_rsa_aes_128_sha,+ecdhe_rsa_aes_256_sha,+rsa_aes_128_sha,+rsa_aes_256_sha
Alternatively, use the following commands to set the values for you:#
sed -i 's/^NSSProtocol .*/NSSProtocol TLSv1.2/' /etc/httpd/conf.d/nss.conf#sed -i 's/^NSSCipherSuite .*/NSSCipherSuite +ecdhe_ecdsa_aes_128_sha,+ecdhe_ecdsa_aes_256_sha,+ecdhe_rsa_aes_128_sha,+ecdhe_rsa_aes_256_sha,+rsa_aes_128_sha,+rsa_aes_256_sha/' /etc/httpd/conf.d/nss.conf - Restart the
httpddaemon:#
systemctl restart httpd
35.2. Configuring the Directory Server Component
- Stop DS:
#
systemctl stop dirsrv@EXAMPLE-COM.service - Open the
/etc/dirsrv/slapd-EXAMPLE-COM/dse.ldiffile, and modify thecn=encryption,cn=configentry to set the following:sslVersionMin: TLS1.2
- Start DS:
#
systemctl start dirsrv@EXAMPLE-COM.service
ldapmodify utility:
- Use
ldapmodifyto make the configuration changes for you:ldapmodify -h localhost -p 389 -D 'cn=directory manager' -W << EOF dn: cn=encryption,cn=config changeType: modify replace: sslVersionMin sslVersionMin: TLS1.2 EOF
- Restart DS to load the new configuration:
#
systemctl restart dirsrv@EXAMPLE-COM.service
35.3. Configuring the Certificate Server Component
- To configure Certificate Server (CS) manually, open the
/etc/pki/pki-tomcat/server.xmlfile. Set all occurrences of thesslVersionRangeStreamandsslVersionRangeDatagramparameters to the following values:sslVersionRangeStream="tls1_2:tls1_2" sslVersionRangeDatagram="tls1_2:tls1_2"
Alternatively, use the following command to replace the values for you:#
sed -i 's/tls1_[01]:tls1_2/tls1_2:tls1_2/g' /etc/pki/pki-tomcat/server.xml - Restart CS:
#
systemctl restart pki-tomcatd@pki-tomcat.service
35.4. Result
Chapter 36. Disabling Anonymous Binds
nsslapd-allow-anonymous-access attribute.
- Change the
nsslapd-allow-anonymous-accessattribute torootdse.$ ldapmodify -x -D "cn=Directory Manager" -W -h server.example.com -p 389 -ZZ Enter LDAP Password: dn: cn=config changetype: modify replace: nsslapd-allow-anonymous-access nsslapd-allow-anonymous-access: rootdse modifying entry "cn=config"
Important
Anonymous access can be completely allowed (on) or completely blocked (off). However, completely blocking anonymous access also blocks external clients from checking the server configuration. LDAP and web clients are not necessarily domain clients, so they connect anonymously to read the root DSE file to get connection information.Therootdseallows access to the root DSE and server configuration without any access to the directory data. - Restart the 389 Directory Server instance to load the new setting.
# systemctl restart dirsrv.target
Part IX. Performance Tuning
Chapter 37. Performance Tuning for Bulk Provisioning of Entries
- Identity Management (IdM) reads entries to be provisioned from an LDIF file and then imports them to the target IdM LDAP instance.
- The administrator sets custom values for certain attributes, such as cache sizes, and disables the MemberOf and Schema Compatibility plug-ins. The procedure includes running the
fixup-memberof.plplug-in on the provisioned entries to compensate for disabling MemberOf.
Recommendations and Prerequisites for Bulk Provisioning
- When provisioning a large number of entries (10,000 or more), do not allow any LDAP client to access the server on which the entries are provisioned or to rely on the information from the server. For example, you can achieve this by disabling ports 389 and 636 on the server and using LDAPI to work over Unix sockets.Reason: The MemberOf plug-in is disabled on the server, which means that membership information on the server is not valid.
- Stop applications that are not required to be running during the provisioning.Reason: This helps free as much memory on the machine as possible. The free memory will be used by the file system cache, thus improving the performance of the provisioning.Note that the procedure below already includes steps to stop the IdM services, and restart only the Directory Server (DS) instance. IdM services, especially
tomcat, consume a lot of memory, but are not used during the provisioning. - Run the procedure on a fresh IdM deployment with only one server. Create replicas only after the provisioning has been completed.Reason: The provisioning throughput is much faster than replication. In a deployment with more that one server, information on the replicas would become significantly outdated.
- Generate an LDIF file containing the entries you want to provision. For example, if you are migrating an existing IdM deployment, create the LDIF file by exporting all the entries using the
ldapsearchutility.For details on the LDIF format, see About the LDIF File Format in the Red Hat Directory Server Administration Guide.
Backing up the Current DS Tuning Parameter Values
- Retrieve the current values for the DS tuning parameters:
- the database cache size and database locks:
# ldapsearch -D "cn=directory manager" -w secret -b "cn=config,cn=ldbm database,cn=plugins,cn=config" nsslapd-dbcachesize nsslapd-db-locks ... nsslapd-dbcachesize: 10000000 nsslapd-db-locks: 50000 ...
- the entry cache size and DN cache size:
# ldapsearch -D "cn=directory manager" -w secret -b "cn=userRoot,cn=ldbm database,cn=plugins,cn=config" nsslapd-cachememsize nsslapd-dncachememsize ... nsslapd-cachememsize: 10485760 nsslapd-dncachememsize: 10485760 ...
- Make note of the obtained values. You will reset the parameters back to these values after you finish the provisioning.
Adjusting the Database, Domain Entry, and DN Cache Size
- Determine the required value.The recommended value is typically between 200 MB and 500 MB. The value appropriate for your use case depends on the memory available on your system:
- More than 8 GB of memory → 500 MB
- 8 GB - 4 GB of memory → 200 MB
- Less than 4 GB of memory → 100 MB
- Set the determined value by using this template:
dn: cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify replace: nsslapd-dbcachesize nsslapd-dbcachesize: db_cache_size_in_bytes
For an example of modifying LDAP attributes using theldapmodifyutility, see Example 37.1, “Usingldapmodifyto Change an LDAP Attribute”.
Example 37.1. Using ldapmodify to Change an LDAP Attribute
- Run the
ldapmodifycommand, and then add the statements to modify the attribute value. For example:# ldapmodify -D "cn=directory manager" -w secret -x dn: cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify replace: nsslapd-dbcachesize nsslapd-dbcachesize: 200000000
- Press Ctrl+D to confirm and send the changes to the server. If the operation finishes successfully, the following message is displayed:
modifying entry "cn=config,cn=ldbm database,cn=plugins,cn=config"
- Determine the required value.The recommended value is between 100 MB and 400 MB. The appropriate value depends on the memory available on your system:
- More than 4 GB of memory → 400 MB
- 2 GB - 4 GB of memory → 200 MB
- Less than 2 GB of memory → 100 MB
If you are provisioning a large static group, it is recommended that the entry cache is large enough to fit all entries: groups and members. - Set the determined value by using this template:
dn: cn=userRoot,cn=ldbm database,cn=plugins,cn=config changetype: modify replace: nsslapd-cachememsize nsslapd-cachememsize: entry_cache_size_in_bytes
- For the best possible performance, it is recommended that the DN cache fits all the DNs of the provisioned entries. To estimate the value appropriate for your use case:
- Determine the number of all DN entries in the file. The DN entries are on lines starting with
dn:. For example, using# grep,sed, andwc:# grep '^dn: ' ldif_file | sed 's/^dn: //' | wc -l 92200
- Determine the size of all DN entry strings in the LDIF file.
# grep '^dn: ' ldif_file | sed 's/^dn: //' | wc -c 9802460
- Get the average DN size: divide the size of all DN entry strings by the number of all the DN entries in the file.For example: 9,802,460 / 92,200 ≈ 106
- Get the average memory size: multiple the average DN size by 2, and then add 32 to the result.For example: (106 * 2) + 32 = 244
- Get the appropriate DN cache size: multiply the average memory size by the total number of DN entries in the LDIF file.For example: 244 * 92,200 = 22,496,800
- Set the determined value by using this template:
dn: cn=userRoot,cn=ldbm database,cn=plugins,cn=config changetype: modify Replace: nsslapd-dncachememsize Nsslapd-dncachememsize: dn_cache_size
Disabling Unnecessary Services and Adjusting Database Locks
- Disable the MemberOf and Schema Compatibility plug-ins:
dn: cn=MemberOf Plugin,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: off
dn: cn=Schema Compatibility,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: off
Disabling MemberOf significantly speeds up the provisioning. Disabling Schema Compatibility also helps reduce the duration of the operation.For an example of modifying LDAP attributes using theldapmodifyutility, see Example 37.1, “Usingldapmodifyto Change an LDAP Attribute”. - If no replicas are installed in your topology (as recommended in the section called “Recommendations and Prerequisites for Bulk Provisioning”), disable the Content Synchronization and Retro Changelog plug-ins:
dn: cn=Content Synchronization,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: off
dn: cn=Retro Changelog Plugin,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: off
Disabling these additional plug-ins helps improve the performance of the provisioning. - Stop the IdM server. This also stops the DS instance.
# ipactl stop
Stopping DS is required to set the number of database locks in the next step. You will restart it again later. - Adjust the number of database locks. The appropriate value equals half the number of provisioned entries.
- the minimum value is 10,000
- the maximum value is 200,000
Because DS is stopped, you must set the value by modifying the/etc/dirsrv/slapd-EXAMPLE-COM/dse.ldiffile:dn: cn=config,cn=ldbm database,cn=plugins,cn=config ... nsslapd-db-locks: db_lock_number
IdM accesses a large number of database pages when computing membership. The more pages it accesses, the more locks are required for the provisioning. - Start DS:
# systemctl start dirsrv.target
Importing the Entries
ldapadd utility:
# ldapadd -D "binddn" -y password_file -f ldif_file
ldapadd, see the ldapadd(1) man page.
Re-enabling the Disabled Services and Restoring the Original Attribute Values
- Enable MemberOf:
dn: cn=MemberOf Plugin,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: on
For an example of modifying LDAP attributes using theldapmodifyutility, see Example 37.1, “Usingldapmodifyto Change an LDAP Attribute”. - Restart DS:
# systemctl restart dirsrv.target
Restarting DS at this point is required because you enabled MemberOf in the previous step. - Run the
fixup-memberof.plscript with the(objectClass=*)filter to regenerate and update thememberOfattribute on all provisioned entries. For example:# fixup-memberof.pl -D "cn=directory manager" -j password_file -Z server_id -b "suffix" -f "(objectClass=*)" -P LDAP
Runningfixup-memberof.plis necessary because the MemberOf plug-in was disabled when you imported the entries. To be able to continue with the provisioning, the script must complete successfully.For details onfixup-memberof.pl, see the fixup-memberof.pl(8) man page. - Enable the Schema Compatibility plug-in:
dn: cn=Schema Compatibility,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: on
- If you disabled the Content Synchronization and Retro Changelog plug-ins in the section called “Disabling Unnecessary Services and Adjusting Database Locks”, re-enable them:
dn: cn=Content Synchronization,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: on
dn: cn=Retro Changelog Plugin,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: on
- Restore the original values for the database cache, entry cache, and DN cache size that you backed up in the section called “Backing up the Current DS Tuning Parameter Values”:
dn: cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify replace: nsslapd-dbcachesize nsslapd-dbcachesize: backup_db_cache_size dn: cn=userRoot,cn=ldbm database,cn=plugins,cn=config changetype: modify Replace: nsslapd-dncachememsize Nsslapd-dncachememsize: backup_dn_cache_size - replace: nsslapd-cachememsize nsslapd-cachememsize: backup_entry_cache_size
- Stop DS:
# systemctl stop dirsrv.target
- Restore the original value for database locks that you backed up in the section called “Backing up the Current DS Tuning Parameter Values”. Because DS is stopped, you must set the value by modifying the
/etc/dirsrv/slapd-EXAMPLE-COM/dse.ldiffile:dn: cn=config,cn=ldbm database,cn=plugins,cn=config ... nsslapd-db-locks: backup_db_lock_number
- Start the IdM server:
# ipactl start
This starts all IdM services, including DS.
Chapter 38. Failover, load balancing and high availability in Identity Management
System Security Services Daemon (SSSD).
Client-side failover capability
SSSD obtains service (SRV) resource records from DNS servers that the client discovers automatically. Based on the SRV records, SSSD maintains a list of available IdM servers, including the information about the connectivity of these servers. If one IdM server goes offline or is overloaded, SSSD already knows which other server to communicate with.
_ldap._tcp.DOMAIN DNS SRV records for all domains that are parent to the client's hostname. In this way, the installer retrieves the hostname of the IdM server that is most conveniently located for communicating with the client, and uses its domain to configure the client components.
Server-side service availability
Note
Part X. Connecting Other Services to Identity Management
Chapter 39. Setting up Samba to Authenticate Users to the IdM Domain
39.1. Configuring an SSSD Client to Run a Samba Server
Important
Preconditions
ipa-adtrust-install to configure the master to manage object classes and attributes specific to Samba. For details, see the corresponding section in the Red Hat Enterprise Linux Windows Integration Guide.
Setting up Samba to Authenticate Users to the IdM Domain
- Install the required packages for IdM and join the client to the domain. For details, see the corresponding section in the Red Hat Linux Domain Identity, Authentication, and Policy Guide.
- Install the Samba server and the sssd-winbind-idmap package:
# yum install samba sssd-winbind-idmap
- Create the
cifsKerberos principal for Samba server. For example:# ipa service-add cifs/samba_server.idm.example.com
- Retrieve the Kerberos keytab for the
cifsprincipal, and store it in the/etc/samba/samba.keytabfile:# ipa-getkeytab -p cifs/samba_server.idm.example.com -k /etc/samba/samba.keytab
- Set the following parameters in the
[global]section of the/etc/samba/smb.conffile:workgroup = IDM realm = IDM.EXAMPLE.COM security = ads dedicated keytab file = FILE:/etc/samba/samba.keytab kerberos method = dedicated keytab idmap config * : backend = tdb idmap config * : range = 10000-999999 idmap config IDM : backend = sss idmap config IDM : range = 2000000-2999999
- Set up file and printer shares. For details, see the following sections in the Red Hat System Administrator's Guide:
- Verify the
/etc/samba/smb.conffile:# testparm
If thetestparmutility does not return any error, the configuration is valid. - Open the required ports and reload the firewall configuration using the
firewall-cmdutility:# firewall-cmd --permanent --add-service=samba # firewall-cmd --reload
- Start the
smbservice:# systemctl start smb
- Optionally, configure that the
smbservice starts automatically when the system boots:# systemctl enable smb
- Verify that the
sssdservice is enabled and running:# systemctl status sssd
- Verify that the
winbindservice is enabled and running:# systemctl status winbind
Verifying That IdM Users Can Authenticate to Samba
- Install the samba-client package:
# yum install samba-client
- Authenticate to Kerberos:
# kinit user_name
- List the shares:
# smbclient -k -U user_name -L samba_server.idm.example.com
Additional Resources
Part XI. Migration
Chapter 40. Migrating from an LDAP Directory to IdM
40.1. An Overview of an LDAP to IdM Migration
40.1.1. Planning the Client Configuration
Important
40.1.1.1. Initial Client Configuration (Pre-Migration)

Figure 40.1. Basic LDAP Directory and Client Configuration
/etc/passwd or /etc/shadow. (In real life, the infrastructure may be more complex if a client uses LDAP for identity lookups and Kerberos for authentication or other configurations.)
40.1.1.2. Recommended Configuration for Red Hat Enterprise Linux Clients
pam_sss and nss_sss, respectively) which allow SSSD to be integrated very closely with Identity Management and leverage the full authentication and identity features in Identity Management. SSSD has a number of useful features, like caching identity information so that users can log in even if the connection is lost to the central server; these are described in the System-Level Authentication Guide.
pam_ldap and nss_ldap), SSSD establishes relationships between identity and authentication information by defining domains. A domain in SSSD defines four back end functions: authentication, identity lookups, access, and password changes. The SSSD domain is then configured to use a provider to supply the information for any one (or all) of those four functions. An identity provider is always required in the domain configuration. The other three providers are optional; if an authentication, access, or password provider is not defined, then the identity provider is used for that function.
Note

Figure 40.2. Clients and SSSD with an IdM Back End
ipa-client-install script automatically configured SSSD to use IdM for all four of its back end services, so Red Hat Enterprise Linux clients are set up with the recommended configuration by default.
Note
ipa-client. Older versions of Red Hat Enterprise Linux can be configured as described in Section 40.1.1.3, “Alternative Supported Configuration”.
40.1.1.3. Alternative Supported Configuration
nss_ldap) and to IdM as if it were a regular Kerberos KDC (using pam_krb5).

Figure 40.3. Clients and IdM with LDAP and Kerberos
nss_ldap and pam_krb5 to connect to the IdM server. For some maintenance situations and IT structures, a scenario that fits the lowest common denominator may be required, using LDAP for both identity and authentication (nss_ldap and pam_ldap). However, it is generally best practice to use the most secure configuration possible for a client. This means SSSD or LDAP for identities and Kerberos for authentication.
40.1.2. Planning Password Migration
Important
40.1.2.1. Method 1: Using Temporary Passwords and Requiring a Change
40.1.2.2. Method 2: Using the Migration Web Page
https://ipaserver.example.com/ipa/migration
40.1.2.3. Method 3: Using SSSD (Recommended)
- A user tries to log into a machine with SSSD.
- SSSD attempts to perform Kerberos authentication against the IdM server.
- Even though the user exists in the system, the authentication will fail with the error key type is not supported because the Kerberos hashes do not yet exist.
- SSSD then performs a plain text LDAP bind over a secure connection.
- IdM intercepts this bind request. If the user has a Kerberos principal but no Kerberos hashes, then the IdM identity provider generates the hashes and stores them in the user entry.
- If authentication is successful, SSSD disconnects from IdM and tries Kerberos authentication again. This time, the request succeeds because the hash exists in the entry.
40.1.2.4. Migrating Cleartext LDAP Passwords
Note
40.1.2.5. Automatically Resetting Passwords That Do Not Meet Requirements
kinit into the IdM domain.
[jsmith@server ~]$ kinit Password for jsmith@EXAMPLE.COM: Password expired. You must change it now. Enter new password: Enter it again:
40.1.3. Migration Considerations and Requirements
40.1.3.1. LDAP Servers Supported for Migration
ipa migrate-ds, to perform the migration. This script has certain expectations about the structure of the LDAP directory and LDAP entries in order to work. Migration is supported only for LDAPv3-compliant directory services, which include several common directories:
- Sun ONE Directory Server
- Apache Directory Server
- OpenLDAP
Note
40.1.3.2. Migration Environment Requirements
- A single LDAP directory domain is being migrated to one IdM realm. No consolidation is involved.
- User passwords are stored as a hash in the LDAP directory. For a list of supported hashes, see the
passwordStorageSchemeattribute in the Password Policy Attributes table in the Red Hat Directory Server 10 Administration Guide. - The LDAP directory instance is both the identity store and the authentication method. Client machines are configured to use
pam_ldapornss_ldapto connect to the LDAP server. - Entries use only the standard LDAP schema. Entries that contain custom object classes or attributes are not migrated to Identity Management.
40.1.3.3. Migration — IdM System Requirements
- 4 cores
- 4GB of RAM
- 30GB of disk space
- A SASL buffer size of 2MB (default for an IdM server)In case of migration errors, increase the buffer size:
[root@ipaserver ~]# ldapmodify -x -D 'cn=directory manager' -w password -h ipaserver.example.com -p 389 dn: cn=config changetype: modify replace: nsslapd-sasl-max-buffer-size nsslapd-sasl-max-buffer-size: 4194304 modifying entry "cn=config"
Set thensslapd-sasl-max-buffer-sizevalue in bytes.
40.1.3.4. Migration Tools
ipa migrate-ds, to drive the migration process so that LDAP directory data are properly formatted and imported cleanly into the IdM server. When using ipa migrate-ds, the remote system user, specified by the --bind-dn option, needs to have read access to the userPassword attribute, otherwise passwords will not be migrated.
40.1.3.5. Improving Migration Performance
- The
nsslapd-cachememsizeattribute, which defines the size allowed for the entry cache. This is a buffer, that is automatically set to 80% of the total cache memory size. For large import operations, this parameter (and possibly the memory cache itself) can be increased to more efficiently handle a large number of entries or entries with larger attributes.For details how to modify the attribute using theldapmodify, see corresponding section in the Red Hat Directory Server Performance Tuning Guide. - The system
ulimitconfiguration option sets the maximum number of allowed processes for a system user. Processing a large database can exceed the limit. If this happens, increase the value:[root@server ~]# ulimit -u 4096
40.1.3.6. Migration Sequence
- Deploy SSSD.
- Reconfigure clients to connect to the current LDAP server and then fail over to IdM.
- Install the IdM server.
- Migrate the user data using the IdM
ipa migrate-dsscript. This exports the data from the LDAP directory, formats for the IdM schema, and then imports it into IdM. - Take the LDAP server offline and allow clients to fail over to Identity Management transparently.
- Install the IdM server.
- Migrate the user data using the IdM
ipa migrate-dsscript. This exports the data from the LDAP directory, formats it for the IdM schema, and then imports it into IdM. - Optional. Deploy SSSD.
- Reconfigure clients to connect to IdM. It is not possible to simply replace the LDAP server. The IdM directory tree — and therefore user entry DNs — is different than the previous directory tree.While it is required that clients be reconfigured, clients do not need to be reconfigured immediately. Updated clients can point to the IdM server while other clients point to the old LDAP directory, allowing a reasonable testing and transition phase after the data are migrated.
Note
Do not run both an LDAP directory service and the IdM server for very long in parallel. This introduces the risk of user data being inconsistent between the two services.
40.2. Examples for Using ipa migrate-ds
ipa migrate-ds command. At its simplest, the command takes the LDAP URL of the directory to migrate and exports the data based on common default settings.
ipa migrate-ds ldap://ldap.example.com:389
- Migrated entries
- The
migrate-dscommand only migrates accounts containing agidNumberattribute, that is required by theposixAccountobject class, and asnattribute, that is required by thepersonobject class. - Customizing the process
- The
ipa migrate-dscommand enables you to customize how data is identified and exported. This is useful if the original directory tree has a unique structure or if some entries or attributes within entries should be excluded. For further details, pass the--helpto the command. - Bind DN
- By default, the DN "
cn=Directory Manager" is used to bind to the remote LDAP directory. Pass the--bind-dnoption to the command to specify a custom bind DN. For further information, see Section 40.1.3.4, “Migration Tools”. - Naming context changes
- If the Directory Server naming context differs from the one used in Identity Management, the base DNs for objects is transformed. For example:
uid=user,ou=people,dc=ldap,dc=example,dc=comis migrated touid=user,ou=people,dc=idm,dc=example,dc=com. Pass the--base-dnto theipa migrate-dscommand to set the base DN used on the remote LDAP server for the migration.
40.2.1. Migrating Specific Subtrees
ou=People subtree and group entries in the ou=Groups subtree. These subtrees are container entries for those different types of directory data. If no options are passed with the migrate-ds command, then the utility assumes that the given LDAP directory uses the ou=People and ou=Groups structure.
--user-container--group-container
Note
>ou=Employees,dc=example,dc=com directory tree can be migrated using --user-container=ou=Employees.
[root@ipaserver ~]# ipa migrate-ds --user-container=ou=employees \
--group-container="ou=employee groups" \
ldap://ldap.example.com:389--scope option to the ipa migrate-ds command, to set a scope:
onelevel: Default. Only entries in the specified container are migrated.subtree: Entries in the specified container and all subcontainers are migrated.base: Only the specified object itself is migrated.
40.2.2. Specifically Including or Excluding Entries
ipa migrate-ds script imports every user entry with the person object class and every group entry with the groupOfUniqueNames or groupOfNames object class..
fullTimeEmployee object class:
[root@ipaserver ~]# ipa migrate-ds --user-objectclass=fullTimeEmployee ldap://ldap.example.com:389
[root@ipaserver ~]# ipa migrate-ds --group-objectclass=groupOfNames --group-objectclass=groupOfUniqueNames ldap://ldap.example.com:389
[root@ipaserver ~]# ipa migrate-ds --exclude-groups="Golfers Group" --exclude-users=jsmith --exclude-users=bjensen ldap://ldap.example.com:389
uid and to groups matching it in the cn attribute.
fullTimeEmployee object class, yet excludes three managers:
[root@ipaserver ~]# ipa migrate-ds --user-objectclass=fullTimeEmployee --exclude-users=jsmith --exclude-users=bjensen --exclude-users=mreynolds ldap://ldap.example.com:389
40.2.3. Excluding Entry Attributes
userCertificate attribute.
migrate-ds by using any of several different options:
--user-ignore-objectclass--user-ignore-attribute--group-ignore-objectclass--group-ignore-attribute
userCertificate attribute and strongAuthenticationUser object class for users and the groupOfCertificates object class for groups:
[root@ipaserver ~]# ipa migrate-ds --user-ignore-attribute=userCertificate --user-ignore-objectclass=strongAuthenticationUser --group-ignore-objectclass=groupOfCertificates ldap://ldap.example.com:389
Note
40.2.4. Setting the Schema to Use
--schema option to the ipa migrate-ds command:
[root@ipaserver ~]# ipa migrate-ds --schema=RFC2307 ldap://ldap.example.com:389
40.3. Migrating an LDAP Server to Identity Management
Important
- Install the IdM server, including any custom LDAP directory schema, on a different machine from the existing LDAP directory.
Note
Custom user or group schemas have limited support in IdM. They can cause problems during the migration because of incompatible object definitions. - Disable the compat plug-in.
[root@server ~]# ipa-compat-manage disable
This step is not necessary if the data provided by the compat tree is required during the migration. - Restart the IdM Directory Server instance.
[root@server ~]# systemctl restart dirsrv.target
- Configure the IdM server to allow migration:
[root@server ~]# ipa config-mod --enable-migration=TRUE
- Run the IdM migration script,
ipa migrate-ds. At its most basic, this requires only the LDAP URL of the LDAP directory instance to migrate:[root@server ~]# ipa migrate-ds ldap://ldap.example.com:389
Simply passing the LDAP URL migrates all of the directory data using common default settings. The user and group data can be selectively migrated by specifying other options, as covered in Section 40.2, “Examples for Usingipa migrate-ds”.If the compat plug-in was not disabled in the previous step, pass the--with-compatoption toipa migrate-ds.Once the information is exported, the script adds all required IdM object classes and attributes and converts DNs in attributes to match the IdM directory tree, if the naming context differs. For example:uid=user,ou=people,dc=ldap,dc=example,dc=comis migrated touid=user,ou=people,dc=idm,dc=example,dc=com. - Re-enable the compat plug-in, if it was disabled before the migration.
[root@server ~]# ipa-compat-manage enable
- Restart the IdM Directory Server instance.
[root@server ~]# systemctl restart dirsrv.target
- Disable the migration mode:
[root@server ]# ipa config-mod --enable-migration=FALSE
- Optional. Reconfigure non-SSSD clients to use Kerberos authentication (
pam_krb5) instead of LDAP authentication (pam_ldap). Use PAM_LDAP modules until all of the users have been migrated; then it is possible to use PAM_KRB5. For further information, see the corresponding section in the System-level Authentication Guide. - There are two ways for users to generate their hashed Kerberos password. Both migrate the users password without additional user interaction, as described in Section 40.1.2, “Planning Password Migration”.
- Using SSSD:
- Move clients that have SSSD installed from the LDAP back end to the IdM back end, and enroll them as clients with IdM. This downloads the required keys and certificates.On Red Hat Enterprise Linux clients, this can be done using the
ipa-client-installcommand. For example:[root@server ~]# ipa-client-install --enable-dns-update
- Using the IdM migration web page:
- Instruct users to log into IdM using the migration web page:
https://ipaserver.example.com/ipa/migration
- To monitor the user migration process, query the existing LDAP directory to see which user accounts have a password but do not yet have a Kerberos principal key.
[user@server ~]$ ldapsearch -LL -x -D 'cn=Directory Manager' -w secret -b 'cn=users,cn=accounts,dc=example,dc=com' '(&(!(krbprincipalkey=*))(userpassword=*))' uid
Note
Include the single quotes around the filter so that it is not interpreted by the shell. - When the migration of all clients and users is complete, decommission the LDAP directory.
40.4. Migrating over SSL
- Store the certificate of the CA, that issued the remote LDAP server's certificate, in a file on the IdM server. For example:
/etc/ipa/remote.crt. - Follow the steps described in Section 40.3, “Migrating an LDAP Server to Identity Management”. However for an encrypted LDAP connection during the migration, use the
ldapsprotocol in the URL and pass the--ca-cert-fileoption to the command. For example:[root@ipaserver ~]# ipa migrate-ds --ca-cert-file=/etc/ipa/remote.crt ldaps://ldap.example.com:636
Appendix A. Troubleshooting: General Guidelines
Note
A.1. Investigating Failures when Executing the ipa Utility
Basic Troubleshooting
- Add the
--verbose(-v) option to the command. This displays debug information. - Add the
-vvoption to the command. This displays the JSON response and request.
Advanced Troubleshooting
ipa cert-show command” shows which components interact when the user uses the IdM command-line utility. Querying these components can help you investigate where the problem occurred and what caused it.
- Use the following utilities:
hostto check the DNS resolution of the IdM server or clientpingto check if the IdM server is availableiptablesto check the current firewall configuration on the IdM serverdateto check the current timencto try to connect to the required ports, as listed in Section 2.1.4, “Port Requirements”
For details on using these utilities, see their man pages. - Set the
KRB5_TRACEenvironment variable to the/dev/stdoutfile to send trace-logging output to/dev/stdout:$ KRB5_TRACE=/dev/stdout ipa cert-findReview the Kerberos key distribution center (KDC) log:/var/log/krb5kdc.log. - Review the Apache error log:
- Enable debug level on the server: Open the
/etc/ipa/server.conffile, and add thedebug=Trueoption to the[global]section. - Restart the
httpdservice:# systemctl restart httpd.service - Run the command that failed again.
- Review the
httpderror log on the server:/var/log/httpd/error_log.
Run the command with the-vvvoption to display the HTTP request and response. - Review the Apache access log:
/var/log/httpd/access_log.Review the logs for the Certificate System component:/var/log/pki/pki-ca-spawn.time_of_installation.log/var/log/pki/pki-tomcat/ca/debug/var/log/pki/pki-tomcat/ca/system/var/log/pki/pki-tomcat/ca/selftests.log- Use the
# journalctl -u pki-tomcatd@pki-tomcat.servicecommand to review thejournallog.
- Review the Directory Server access log:
/var/log/dirsrv/slapd-IPA-EXAMPLE-COM/access.

Figure A.1. The architecture of executing the ipa cert-show command
Related Information
- See Section C.2, “Identity Management Log Files and Directories” for descriptions of various Identity Management log files.
A.2. Investigating kinit Authentication Failures
General Troubleshooting
- On the IdM client, display the debug messages from the
kinitprocess:$ KRB5_TRACE=/dev/stdout kinit admin - Verify that:
- The client forward record is correct both on the server and on the affected client:
# host client_fully_qualified_domain_name - The server forward record is correct both on the server and on the affected client:
# host server_fully_qualified_domain_name# host server_IP_addressThehost server_IP_addresscommand must return a fully qualified host name with a trailing dot at the end, such as:server.example.com.
- Review the
/etc/hostsfile on the client, and make sure that:- All server entries in the file are correct
- In all server entries, the first name is a fully qualified domain name
See also the section called “The/etc/hostsFile”. - Make sure you meet the other conditions in Section 2.1.3, “Host Name and DNS Configuration”.
- On the IdM server, make sure that the
krb5kdcanddirsrvservices are running:# systemctl status krb5kdc# systemctl status dirsrv.target - Review the Kerberos key distribution center (KDC) log:
/var/log/krb5kdc.log. - If the KDCs are hard-coded in the
/etc/krb5.conffile (the file explicitly sets KDC directives and uses thedns_lookup_kdc = falsesetting), use theipactl statuscommand on each master server. Check the status of the IdM services on each server listed as KDC by the command:# ipactl statusDirectory Service: RUNNING krb5kdc Service: RUNNING kadmin Service: RUNNING named Service: RUNNING httpd Service: RUNNING ipa-custodia Service: RUNNING ntpd Service: RUNNING pki-tomcatd Service: RUNNING ipa-otpd Service: RUNNING ipa-dnskeysyncd Service: RUNNING ipa: INFO: The ipactl command was successful
Troubleshooting Errors Cannot find KDC for realm
kinit authentication fails with an error that says Cannot find KDC for realm "EXAMPLE.COM" while getting initial credentials, it indicates that KDC is not running on the server or that the client has misconfigured DNS. In this situation, try these steps:
- If the DNS discovery is enabled in the
/etc/krb5.conffile (thedns_lookup_kdc = truesetting), use thedigutility to check whether the following records are resolvable:$ dig -t TXT _kerberos.ipa.example.com$ dig -t SRV _kerberos._udp.ipa.example.com$ dig -t SRV _kerberos._tcp.ipa.example.comIn the following example, one of thedigcommands above failed with this output:; <<>> DiG 9.11.0-P2-RedHat-9.11.0-6.P2.fc25 <<>> -t SRV _kerberos._tcp.ipa.server.example ;; global options: +cmd ;; connection timed out; no servers could be reached
The output indicated that thenamedservice was not running on the master server. - If DNS lookup fails, continue with the steps in Section A.6, “Troubleshooting DNS”.
Related Information
- See Section C.2, “Identity Management Log Files and Directories” for descriptions of various Identity Management log files.
A.3. Investigating IdM Web UI Authentication Failures
- Make sure the user can authenticate from the command line using the
kinitutility. If the authentication fails, see also Section A.2, “InvestigatingkinitAuthentication Failures”. - Make sure that the
httpdanddirsrvservices on the affected server are running:# systemctl status httpd.service# systemctl status dirsrv@IPA-EXAMPLE-COM.service - Make sure no related SELinux Access Vector Cache (AVC) messages are logged in the
/var/log/audit/audit.logand/var/log/messagesfiles.See Basic SELinux Troubleshooting in CLI in the Red Hat Knowledgebase for details on resolving AVC messages. - Make sure that cookies are enabled on the browser from which you are authenticating.
- Make sure that the time difference between the IdM server and the system on which you are authenticating is 5 minutes at the most.
- Review the Apache error log:
/var/log/httpd/error_log. - Enable verbose logging for the authentication process to help diagnose the problem. See Firefox Configuration for Kerberos Troubleshooting in the System-Level Authentication Guide for advice on how to enable verbose logging in Firefox.
- In the
/etc/httpd/conf.d/nss.conffile, change theLogLevelattribute toinfo. - Restart the Apache server:
# systemctl restart httpd - Try logging in with the certificate again.
- Review the Apache error log:
/var/log/httpd/error_log.The log shows messages recorded by themod_lookup_identitymodule, including information about whether the module successfully matched the user during the login attempt or not.
Related Information
- See Section C.2, “Identity Management Log Files and Directories” for descriptions of various Identity Management log files.
A.4. Investigating Smart Card Authentication Failures
- Open the
/etc/sssd/sssd.conffile, and set thedebug_leveloption to2. - Review the
sssd_pam.logandsssd_EXAMPLE.COM.logfiles. If you see timeout error message in the files, see Section B.4.4, “Smart Card Authentication Fails with Timeout Error Messages”.
A.5. Investigating Why a Service Fails to Start
- Review the log for the service that fails to start. See Section C.2, “Identity Management Log Files and Directories”.For example, the log for Directory Server is at
/var/log/dirsrv/slapd-IPA-EXAMPLE-COM/errors. - Make sure that the server on which the service is running has a fully qualified domain name (FQDN). See the section called “Verifying the Server Host Name”.
- If the
/etc/hostsfile contains an entry for the server on which the service is running, make sure the fully qualified domain name is listed first. See also the section called “The/etc/hostsFile”. - Make sure you meet the other conditions in Section 2.1.3, “Host Name and DNS Configuration”.
- Determine what keys are included in the keytab that is used for authentication of the service. For example, for the
dirsrvservice ticket:# klist -kt /etc/dirsrv/ds.keytabKeytab name: FILE:/etc/dirsrv/ds.keytab KVNO Timestamp Principal ---- ------------------- ------------------------------------------------------ 2 01/10/2017 14:54:39 ldap/server.example.com@EXAMPLE.COM 2 01/10/2017 14:54:39 ldap/server.example.com@EXAMPLE.COM [... output truncated ...]- Make sure that the displayed principals match the system's FQDN.
- Make sure that the displayed version of the keys (KVNO) in the above-mentioned service keytab match the KVNO in the server keytab. To display the server keytab:
$ kinit admin$ kvno ldap/server.example.com@EXAMPLE.COM - Verify that the forward (A, AAAA, or both) and reverse records on the client match the displayed system name and service principal.
- Verify that the forward (A, AAAA, or both) and reverse records on the client are correct.
- Make sure that the system time difference on the client and the server is 5 minutes at the most.
- Services can fail to start after the IdM administrative server certificates expire. To check if this is the cause in your case:
- Use the
getcert listcommand to list all certificates tracked by thecertmongerutility. - In the output, find the IdM administrative certificates: the
ldapandhttpdserver certificates. - Examine the fields labeled
statusandexpires.# getcert listNumber of certificates and requests being tracked: 8. [... output truncated ...] Request ID '20170421124617': status: MONITORING stuck: no key pair storage: type=NSSDB,location='/etc/dirsrv/slapd-IPA-EXAMPLE-COM',nickname='Server-Cert',token='NSS Certificate DB',pinfile='/etc/dirsrv/slapd-IPA-EXAMPLE-COM/pwdfile.txt' certificate: type=NSSDB,location='/etc/dirsrv/slapd-IPA-EXAMPLE-COM',nickname='Server-Cert',token='NSS Certificate DB' CA: IPA issuer: CN=Certificate Authority,O=IPA.EXAMPLE.COM subject: CN=ipa.example.com,O=IPA.EXAMPLE.COM expires: 2019-04-22 12:46:17 UTC [... output truncated ...] Request ID '20170421130535': status: MONITORING stuck: no key pair storage: type=NSSDB,location='/etc/httpd/alias',nickname='Server-Cert',token='NSS Certificate DB',pinfile='/etc/httpd/alias/pwdfile.txt' certificate: type=NSSDB,location='/etc/httpd/alias',nickname='Server-Cert',token='NSS Certificate DB' CA: IPA issuer: CN=Certificate Authority,O=IPA.EXAMPLE.COM subject: CN=ipa.example.com,O=IPA.EXAMPLE.COM expires: 2019-04-22 13:05:35 UTC [... output truncated ...]
If you need to start the service even though the certificates are expired, see Section 26.5, “Allowing IdM to Start with Expired Certificates”.
A.6. Troubleshooting DNS
- Many DNS problems are caused by misconfiguration. Therefore, make sure you meet the conditions in Section 2.1.3, “Host Name and DNS Configuration”.
- Use the
digutility to check the response from the DNS server:# dig _ldap._tcp.ipa.example.com. SRV; <<>> DiG 9.9.4-RedHat-9.9.4-48.el7 <<>> _ldap._tcp.ipa.example.com. SRV ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17851 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 5 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;_ldap._tcp.ipa.example.com. IN SRV ;; ANSWER SECTION: _ldap._tcp.ipa.example.com. 86400 IN SRV 0 100 389 ipaserver.ipa.example.com. ;; AUTHORITY SECTION: ipa.example.com. 86400 IN NS ipaserver.ipa.example.com. ;; ADDITIONAL SECTION: ipaserver.ipa.example.com. 86400 IN A 192.0.21 ipaserver.ipa.example.com 86400 IN AAAA 2001:db8::1 - Use the
hostutility to perform a DNS name lookup:$ host server.ipa.example.comserver.ipa.example.com. 86400 IN A 192.0.21 server.ipa.example.com 86400 IN AAAA 2001:db8::1 - Review the DNS records in LDAP using the
ipa dnszone-showcommand:$ ipa dnszone-show zone_name$ ipa dnsrecord-show zone_name record_name_in_the_zoneFor details on using the IdM tools to manage DNS, see Chapter 33, Managing DNS. - Restart BIND to force resynchronization with LDAP:
$ systemctl restart named-pkcs11 - Get a list of the required DNS records:
$
ipa dns-update-system-records --dry-runUse thedigutility to check if the displayed records are present in DNS. If you use the Identity Management DNS, use theipa dns-update-system-recordscommand to update any missing records.
A.7. Troubleshooting Replication
- Make sure you meet the conditions in Section 2.1.3, “Host Name and DNS Configuration”.
- Make sure that both servers can resolve each other's forward and reverse DNS records:
[root@server1 ~]#
dig +short server2.example.com A[root@server1 ~]#dig +short server2.example.com AAAA[root@server1 ~]#dig +short -x server2_IPv4_or_IPv6_address[root@server2 ~]#
dig +short server1.example.com A[root@server2 ~]#dig +short server1.example.com AAAA[root@server2 ~]#dig +short -x server1_IPv4_or_IPv6_address - Make sure that the time difference on both servers is 5 minutes at the most.
- Review the Directory Server error log on both servers:
/var/log/dirsrv/slapd-SERVER-EXAMPLE-COM/errors. - If you see errors related to Kerberos, make sure that the Directory Server keytab is correct and that you can use it to query the other server (
server2in this example):[root@server1 ~]#
kinit -kt /etc/dirsrv/ds.keytab ldap/server1.example.com[root@server1 ~]#klist[root@server1 ~]#ldapsearch -Y GSSAPI -h server1.example.com -b "" -s base[root@server1 ~]#ldapsearch -Y GSSAPI -h server2_FQDN. -b "" -s base
Related Information
- See Section C.2, “Identity Management Log Files and Directories” for descriptions of various Identity Management log files.
Appendix B. Troubleshooting: Solutions to Specific Problems
- Servers, see Section B.1, “Identity Management Servers”
- Replicas, see Section B.2, “Identity Management Replicas”
- Clients, see Section B.3, “Identity Management Clients”
- Authentication, see Section B.4, “Logging In and Authentication Problems”
- Vaults, see Section B.5, “Vaults”
B.1. Identity Management Servers
B.1.1. External CA Installation Fails
ipa-server-install --external-ca command fails with the following error:
ipa : CRITICAL failed to configure ca instance Command '/usr/sbin/pkispawn -s CA -f /tmp/configuration_file' returned non-zero exit status 1 Configuration of CA failed
env|grep proxy command displays variables such as the following:
env|grep proxy http_proxy=http://example.com:8080 ftp_proxy=http://example.com:8080 https_proxy=http://example.com:8080
What this means:
*_proxy environmental variables are preventing the server from being installed.
To fix the problem:
- Use the following shell script to unset the
*_proxyenvironmental variables:# for i in ftp http https; do unset ${i}_proxy; done - Run the
pkidestroyutility to remove the unsuccessful CA subsystem installation:# pkidestroy -s CA -i pki-tomcat; rm -rf /var/log/pki/pki-tomcat /etc/sysconfig/pki-tomcat /etc/sysconfig/pki/tomcat/pki-tomcat /var/lib/pki/pki-tomcat /etc/pki/pki-tomcat /root/ipa.csr
- Remove the failed IdM server installation:
# ipa-server-install --uninstall
- Retry running
ipa-server-install --external-ca.
B.1.2. named Daemon Fails to Start
named-pkcs11 fails to start. The /var/log/messages file includes an error message related to the named-pkcs11 service and the ldap.so library:
ipaserver named[6886]: failed to dynamically load driver 'ldap.so': libldap-2.4.so.2: cannot open shared object file: No such file or directory
What this means:
named-pkcs11 service from starting.
To fix the problem:
- Uninstall the bind-chroot package.
# yum remove bind-chroot
- Restart the IdM server.
# ipactl restart
B.1.3. Installing a Server Fails on a System with IPv6 Disabled
CRITICAL Failed to restart the directory server Command '/bin/systemctl restart dirsrv@EXAMPLE.service' returned non-zero exit status 1
What this means:
To fix the problem:
B.2. Identity Management Replicas
- For advice on how to test that replication is working, see Section 4.6, “Testing the New Replica”.
- For advice on how to solve replication conflicts, see Resolving Replication Conflicts in the Red Hat Enterprise Linux 6 Identity Management Guide and for details, see Solving Naming Conflicts in the Directory Server Administration Guide
- The Directory Server
repl-monitorscript shows in-progress status of replication, which can help you troubleshoot replication problems. For documentation on the script, see Monitoring Replication from the Command-Line in the Directory Server Administration Guide. - To verify if two Directory Server instances are synchronized, see the Directory Server Administration Guide.
B.2.1. Authenticating AD Users Against a New Replica Fails
What this means:
To fix the problem:
B.2.2. Replica Starts with SASL, GSS-API, and Kerberos Errors in the Directory Server Logs
slapd_ldap_sasl_interactive_bind - Error: could not perform interactive bind for id [] mech [GSSAPI]: error -2 (Local error) (SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure. Minor code may provide more information (Credentials cache file '/tmp/krb5cc_496' not found)) ...
set_krb5_creds - Could not get initial credentials for principal [ldap/ replica1.example.com] in keytab [WRFILE:/etc/dirsrv/ds.keytab]: -1765328324 (Generic error)
What this means:
Replication bind with GSSAPI auth resumed
B.2.3. The DNS Forward Record Does Not Match the Reverse Address
ipa: DEBUG: approved_usage = SSLServer intended_usage = SSLServer ipa: DEBUG: cert valid True for "CN=replica.example.com,O=EXAMPLE.COM" ipa: DEBUG: handshake complete, peer = 192.0.2.2:9444 Certificate operation cannot be completed: Unable to communicate with CMS (Not Found) ... ipa: DEBUG: Created connection context.ldap2_21534032 ipa: DEBUG: Destroyed connection context.ldap2_21534032 The DNS forward record replica.example.com. does not match the reverse address replica.example.org
What this means:
To fix the problem:
B.2.4. Serial Numbers Not Found Errors
Note
0. See Chapter 7, Displaying and Raising the Domain Level for details.
Certificate operation cannot be completed: EXCEPTION (Certificate serial number 0x2d not found)
What this means:
- Replica A issues a certificate to a host.
- The certificate is not replicated to replica B, because the replicas have no certificate replication agreement established.
- A user attempts to use replica B to manage the host.
- Replica B returns an error that it cannot verify the host's certificate serial number. This is because replica B has information about the host in its data directory, but it does not have the host certificate in its certificate directory.
To fix the problem:
- Enable certificate server replication between the two replicas using the
ipa-csreplica-manage connectcommand. See Section D.3.3, “Creating and Removing Replication Agreements”. - Re-initialize one of the replicas from the other to synchronize them. See Section D.3.5, “Re-initializing a Replica”.
Warning
Re-initializing overwrites data on the re-initialized replica with the data from the other replica. Some information might be lost.
B.2.5. Cleaning Replica Update Vector (RUV) Errors
Note
0. See Chapter 7, Displaying and Raising the Domain Level for details.
- The replica has been removed without properly removing its replication agreements first, as described in the section called “Removing Replication Agreements”.
- The replica has been removed when another replica was offline.
What this means:
Note
To fix the problem:
- List the details about the obsolete RUVs using the
ipa-replica-manage list-ruvcommand. The command displays the replica IDs:# ipa-replica-manage list-ruv server1.example.com:389: 6 server2.example.com:389: 5 server3.example.com:389: 4 server4.example.com:389: 12
- Clear the corrupt RUVs using the
ipa-replica-manage clean-ruv replica_IDcommand. The command removes any RUVs associated with the specified replica.Repeat the command for every replica with obsolete RUVs. For example:# ipa-replica-manage clean-ruv 6 # ipa-replica-manage clean-ruv 5 # ipa-replica-manage clean-ruv 4 # ipa-replica-manage clean-ruv 12
Warning
Proceed with extreme caution when usingipa-replica-manage clean-ruv. Running the command against a valid replica ID will corrupt all the data associated with that replica in the replication database.If this happens, re-initialize the replica from another replica as described in Section D.3.5, “Re-initializing a Replica”. - Run
ipa-replica-manage list-ruvagain.- If the command no longer displays any corrupt RUVs, the records have been successfully cleaned.
- If the command still displays corrupt RUVs, clear them manually using this task:
dn: cn=clean replica_ID, cn=cleanallruv, cn=tasks, cn=config objectclass: extensibleObject replica-base-dn: dc=example,dc=com replica-id: replica_ID replica-force-cleaning: no cn: clean replica_ID
- Search all your servers for active replica IDs. Make a list of uncorrupted and reliable replica IDs.To find the IDs of valid replicas, run this LDAP query for all the nodes in your topology:
# ldapsearch -p 389 -h IdM_node -D "cn=directory manager" -W -b "cn=config" "(objectclass=nsds5replica)" nsDS5ReplicaId
- Run
ipa-replica-manage list-ruvon every server. Note any replica IDs that are not on the list of uncorrupted replica IDs. - Run
ipa-replica-manage clean-ruv replica_IDfor every corrupted replica ID.
B.2.6. Recovering a Lost CA Server
Note
0. See Chapter 7, Displaying and Raising the Domain Level for details.
What this means:
To fix the problem:
- Recover the CA server from backup. See Section 9.2, “Restoring a Backup” for details.This makes the CA server available to the replica.
- Delete the replication agreements between the initial server and the replica to avoid replication conflicts. See Section D.3.3, “Creating and Removing Replication Agreements”.
- Install the CA on the replica. See Section 6.5.2, “Promoting a Replica to a Master CA Server”.
- Decommission the original CA server. See Section D.3.6, “Removing a Replica”.
B.3. Identity Management Clients
- To validate your
/etc/sssd.conffile, see SSSD Configuration Validation in the System-Level Authentication Guide.
B.3.1. The Client Is Unable to Resolve Reverse Lookups when Using an External DNS
Jun 30 11:11:48 server1 krb5kdc[1279](info): AS_REQ (4 etypes {18 17 16 23}) 192.0.2.1: NEEDED_PREAUTH: admin EXAMPLE COM for krbtgt/EXAMPLE COM EXAMPLE COM, Additional pre-authentication required
Jun 30 11:11:48 server1 krb5kdc[1279](info): AS_REQ (4 etypes {18 17 16 23}) 192.0.2.1: ISSUE: authtime 1309425108, etypes {rep=18 tkt=18 ses=18}, admin EXAMPLE COM for krbtgt/EXAMPLE COM EXAMPLE COM
Jun 30 11:11:49 server1 krb5kdc[1279](info): TGS_REQ (4 etypes {18 17 16 23}) 192.0.2.1: UNKNOWN_SERVER: authtime 0, admin EXAMPLE COM for HTTP/server1.wrong.example.com@EXAMPLE.COM, Server not found in Kerberos databaseWhat this means:
To fix the problem:
- Verify your DNS configuration, and make sure the DNS domains used by IdM are properly delegated. See Section 2.1.3, “Host Name and DNS Configuration” for details.
- Verify your reverse (PTR) DNS records settings. See Chapter 33, Managing DNS for details.
B.3.2. The Client Is Not Added to the DNS Zone
ipa-client-install utility, the nsupdate utility fails to add the client to the DNS zone.
What this means:
To fix the problem:
- Verify your configuration for DNS delegation from the parent zone to IdM. See Section 2.1.3, “Host Name and DNS Configuration” for details.
- Make sure that dynamic updates are allowed in the IdM zone. See Section 33.5.1, “Enabling Dynamic DNS Updates” for details.
B.3.3. Client Connection Problems
getent passwd admin command, fail.
What this means:
To fix the problem:
/var/log/sssd/ directory. The directory includes a log file for the DNS domain, such as sssd_example.com.log.
- In the
/etc/sssd/sssd.conffile, look up the[domain/example.com]section. Adjust thedebug_leveloption to record more information in the logs.debug_level = 9
- Restart the
sssdservice.# systemctl start sssd
- Examine
sssd_example.com.logagain. The file now includes more error messages.
B.4. Logging In and Authentication Problems
B.4.1. Kerberos GSS Failures When Running ipa Commands
ipa command. For example:
ipa: ERROR: Kerberos error: ('Unspecified GSS failure. Minor code may provide more information', 851968)/('Decrypt integrity check failed', -1765328353)What this means:
To fix the problem:
- See Section 2.1.3, “Host Name and DNS Configuration” for DNS requirements for IdM servers.
- See DNS and Realm Settings in the Windows Integration Guide for DNS requirements for Active Directory trust.
B.4.2. SSH Connection Fails when Using GSS-API
What this means:
To fix the problem:
GSSAPITrustDNS to no in the /etc/ssh/ssh_config file. Instead of using reverse DNS records, SSH will pass the given user name directly to GSS-API.
B.4.3. OTP Token Out of Sync
To fix the problem:
- In the IdM web UI: Click Sync OTP Token on the login page.

Figure B.1. Sync OTP Token
From the command line: Run theipa otptoken-synccommand. - Provide the information required to resynchronize the token. For example, IdM will ask you to provide your standard password and two subsequent token codes generated by the token.
Note
Resynchronization works even if the standard password is expired. After the token is resynchronized using an expired password, log in to IdM to let the system prompt you to change the password.
B.4.4. Smart Card Authentication Fails with Timeout Error Messages
sssd_pam.log and sssd_EXAMPLE.COM.log files contain timeout error messages, such as these:
Wed Jun 14 18:24:03 2017) [sssd[pam]] [child_handler_setup] (0x2000): Setting up signal handler up for pid [12370] (Wed Jun 14 18:24:03 2017) [sssd[pam]] [child_handler_setup] (0x2000): Signal handler set up for pid [12370] (Wed Jun 14 18:24:08 2017) [sssd[pam]] [pam_initgr_cache_remove] (0x2000): [idmeng] removed from PAM initgroup cache (Wed Jun 14 18:24:13 2017) [sssd[pam]] [p11_child_timeout] (0x0020): Timeout reached for p11_child. (Wed Jun 14 18:24:13 2017) [sssd[pam]] [pam_forwarder_cert_cb] (0x0040): get_cert request failed. (Wed Jun 14 18:24:13 2017) [sssd[pam]] [pam_reply] (0x0200): pam_reply called with result [4]: System error.
What this means:
To fix the problem:
/etc/sssd/sssd.conf file:
- In the
[pam]section, increase thep11_child_timeoutvalue to 60 seconds. - In the
[domain/EXAMPLE.COM]section, increase thekrb5_auth_timeoutvalue to 60 seconds. - If you are using OCSP in the certificate, make sure the OCSP server is reachable. If the OCSP server is not directly reachable, configure a proxy OCSP server by adding the following options to
/etc/sssd/sssd.conf:certificate_verification = ocsp_default_responder=http://ocsp.proxy.url, ocsp_default_responder_signing_cert=nickname
Replace nickname with the nickname of the OCSP signing certificate in the/etc/pki/nssdb/directory.For details on these options, see the sssd.conf(5) man page.
B.5. Vaults
B.5.1. Users Cannot Access Their Vault Due To Insufficient 'add' Privilege
ipa: ERROR: Insufficient access: Insufficient 'add' privilege to add the entry 'cn=testvault,cn=user,cn=users,cn=vaults,cn=kra,dc=example,dc=com'.
What this means:
admin, creates the first user vault for the first user. The first user then cannot access any vaults in his or her own vault container.
To fix the problem:
- Log in as
admin.$
kinit admin - Add user as the container owner:
$
ipa vaultcontainer-add-owner --user=user --users=userOwner users: admin, user Vault user: user ------------------------ Number of owners added 1 ------------------------Bothadminand user now have access to the user's vault container because they are both the owners of the container. - Optional. Verify that the user can now create a new user vault:
$
kinit user$ipa vault-add testvault2------------------------ Added vault "testvault2" ------------------------
Additional Resources
Appendix C. A Reference of Identity Management Files and Logs
C.1. Identity Management Configuration Files and Directories
Table C.1. IdM Server and Client Configuration Files and Directories
| Directory or File | Description |
|---|---|
/etc/ipa/ | The main IdM configuration directory. |
/etc/ipa/default.conf | Primary configuration file for IdM. Referenced when servers and clients start and when the user uses the ipa utility. |
/etc/ipa/server.conf |
An optional configuration file, does not exist by default. Referenced when the IdM server starts.
If the file exists, it takes precedence over
/etc/ipa/default.conf.
|
/etc/ipa/cli.conf |
An optional configuration file, does not exist by default. Referenced when the user uses the
ipa utility.
If the file exists, it takes precedence over
/etc/ipa/default.conf.
|
/etc/ipa/ca.crt | The CA certificate issued by the IdM server's CA. |
~/.ipa/ |
The user-specific IdM directory created on the local system the first time the user runs an IdM command.
Users can set individual configuration overrides by creating user-specific
default.conf, server.conf, or cli.conf files in ~./ipa/.
|
/etc/sssd/sssd.conf | Configuration for the IdM domain and for IdM services used by SSSD. |
/usr/share/sssd/sssd.api.d/sssd-ipa.conf | A schema of IdM-related SSSD options and their values. |
/etc/gssproxy/ | The directory for the configuration of the GSS-Proxy protocol. The directory contains files for each GSS-API service and a general /etc/gssproxy/gssproxy.conf file. |
Table C.2. System Service Files and Directories
| Directory or File | Description |
|---|---|
/etc/sysconfig/ | systemd-specific files |
Table C.3. Web UI Files and Directories
| Directory or File | Description |
|---|---|
/etc/ipa/html/ | A symbolic link for the HTML files used by the IdM web UI. |
/etc/httpd/conf.d/ipa.conf | Configuration files used by the Apache host for the web UI application. |
/etc/httpd/conf.d/ipa-rewrite.conf | |
/etc/httpd/conf/ipa.keytab | The keytab file used by the web server. |
/usr/share/ipa/ | The directory for all HTML files, scripts, and stylesheets used by the web UI. |
/usr/share/ipa/ipa.conf | |
/usr/share/ipa/updates/ | Contains LDAP data, configuration, and schema updates for IdM. |
/usr/share/ipa/html/ | Contains the HTML files, JavaScript files, and stylesheets used by the web UI. |
/usr/share/ipa/migration/ | Contains HTML pages, stylesheets, and Python scripts used for running the IdM server in migration mode. |
/usr/share/ipa/ui/ | Contains the scripts used by the UI to perform IdM operations. |
/etc/httpd/conf.d/ipa-pki-proxy.conf | The configuration file for web-server-to-Certificate-System bridging. |
Table C.4. Kerberos Files and Directories
| Directory or File | Description |
|---|---|
/etc/krb5.conf | The Kerberos service configuration file. |
/var/lib/sss/pubconf/krb5.include.d/ | Includes IdM-specific overrides for Kerberos client configuration. |
Table C.5. Directory Server Files and Directories
| Directory or File | Description |
|---|---|
/var/lib/dirsrv/slapd-REALM_NAME/ | The database associated with the Directory Server instance used by the IdM server. |
/etc/sysconfig/dirsrv | IdM-specific configuration of the dirsrv systemd service. |
/etc/dirsrv/slapd-REALM_NAME/ | The configuration and schema files associated with the Directory Server instance used by the IdM server. |
Table C.6. Certificate System Files and Directories
| Directory or File | Description |
|---|---|
/etc/pki/pki-tomcat/ca/ | The main directory for the IdM CA instance. |
/var/lib/pki/pki-tomcat/conf/ca/CS.cfg | The main configuration file for the IdM CA instance. |
Table C.7. Cache Files and Directories
| Directory or File | Description |
|---|---|
~/.cache/ipa/ | Contains a per-server API schema for the IdM client. IdM caches the API schema on the client for one hour. |
Table C.8. System Backup Files and Directories
| Directory or File | Description |
|---|---|
/var/lib/ipa/sysrestore/ | Contains backups of the system files and scripts that were reconfigured when the IdM server was installed. Includes the original .conf files for NSS, Kerberos (both krb5.conf and kdc.conf), and NTP. |
/var/lib/ipa-client/sysrestore/ | Contains backups of the system files and scripts that were reconfigured when the IdM client was installed. Commonly, this is the sssd.conf file for SSSD authentication services. |
C.2. Identity Management Log Files and Directories
Table C.9. IdM Server and Client Log Files and Directories
| Directory or File | Description |
|---|---|
/var/log/ipaserver-install.log | The installation log for the IdM server. |
/var/log/ipareplica-install.log | The installation log for the IdM replica. |
/var/log/ipaclient-install.log | The installation log for the IdM client. |
/var/log/sssd/ | Log files for SSSD. |
~/.ipa/log/cli.log | The log file for errors returned by XML-RPC calls and responses by the ipa utility. Created in the home directory for the system user who runs the tools, who might have a different user name than the IdM user. |
/etc/logrotate.d/ | The log rotation policies for DNS, SSSD, Apache, Tomcat, and Kerberos. |
Table C.10. Apache Server Log Files
| Directory or File | Description |
|---|---|
/var/log/httpd/ | Log files for the Apache web server. |
/var/log/httpd/access_log | Standard access and error logs for Apache servers. Messages specific to IdM are recorded along with the Apache messages because the IdM web UI and the XML-RPC command-line interface use Apache. |
/var/log/httpd/error_log | |
| For details, see Log Files in the Apache documentation. | |
Table C.11. Certificate System Log Files
| Directory or File | Description |
|---|---|
/var/log/pki/pki-ca-spawn.time_of_installation.log | The installation log for the IdM CA. |
/var/log/pki/pki-kra-spawn.time_of_installation.log | The installation log for the IdM KRA. |
/var/log/pki/pki-tomcat/ | The top level directory for PKI operation logs. Contains CA and KRA logs. |
/var/log/pki/pki-tomcat/ca/ | Directory with logs related to certificate operations. In IdM, these logs are used for service principals, hosts, and other entities which use certificates. |
/var/log/pki/pki-tomcat/kra | Directory with logs related to KRA. |
/var/log/messages | Includes certificate error messages among other system messages. |
| For details, see Configuring Subsystem Logs in the Red Hat Certificate System Administration Guide. | |
Table C.12. Directory Server Log Files
| Directory or File | Description |
|---|---|
/var/log/dirsrv/slapd-REALM_NAME/ |
Log files associated with the Directory Server instance used by the IdM server. Most operational data recorded here are related to server-replica interactions.
|
/var/log/dirsrv/slapd-REALM_NAME/access |
Contain detailed information about attempted access and operations for the domain Directory Server instance.
|
/var/log/dirsrv/slapd-REALM_NAME/errors | |
/var/log/dirsrv/slapd-REALM_NAME/audit | Contains audit trails of all Directory Server operations when auditing is enabled in the Directory Server configuration. |
| For details, see Monitoring Server and Database Activity and Log File Reference in the Red Hat Directory Server documentation. | |
Table C.13. Kerberos Log Files
| Directory or File | Description |
|---|---|
/var/log/krb5kdc.log | The primary log file for the Kerberos KDC server. |
/var/log/kadmind.log | The primary log file for the Kerberos administration server. |
Locations for these files is configured in the krb5.conf file. They can be different on some systems. | |
Table C.14. DNS Log Files
| Directory or File | Description |
|---|---|
/var/log/messages |
Includes DNS error messages among other system messages.
DNS logging in this file is not enabled by default. To enable it, run the
# /usr/sbin/rndc querylog command. To disable logging, run the command again.
|
Additional Resources
- See Using the Journal in the System Administrator's Guide for information on how to use the
journalctlutility. You can usejournalctlto view the logging output ofsystemdunit files.
C.3. IdM Domain Services and Log Rotation
logrotate service to handle log rotation and compression:
named(DNS)httpd(Apache)tomcatsssdkrb5kdc(the Kerberos domain controller)
logrotate configuration files are stored in the /etc/logrotate.d/ directory.
Example C.1. Default httpd Log Rotation File at /etc/logrotate.d/httpd
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
delaycompress
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}Warning
logrotate policy files for most of the services create a new log file with the same name, default owner, and default permissions as the previous log. However, with the files for named and tomcat, a special create rule sets this behavior with explicit permissions as well as user and group ownership.
named and tomcat log files. This is required for both IdM operations and SELinux settings. Changing the ownership of the log rotation policy or of the files can cause the IdM domains services to fail.
Additional Resources
- The 389 Directory Server instances used by IdM as a back end and by the Dogtag Certificate System have their own internal log rotation policies. See the Configuring Log Files in the Red Hat Directory Server Administration Guide.
- For details about other potential log rotation settings, such as compression settings or the size of the log files, see the Log Rotation in the System Administrator's Guide or the logrotate(8) man page.
Appendix D. Managing Replicas at Domain Level 0
0 (see Chapter 7, Displaying and Raising the Domain Level). For documentation on managing replicas at domain level 1, see:
D.1. Replica Information File
ipa-replica-prepare utility creates a replica information file named after the replica server in the /var/lib/ipa/ directory. The replica information file is a GPG-encrypted file containing realm and configuration information for the master server.
ipa-replica-install replica setup script configures a Directory Server instance based on the information contained in the replica information file and initiates the replica initialization process, during which the script copies over data from the master server to the replica. A replica information file can only be used to install a replica on the specific machine for which it was created. It cannot be used to create multiple replicas on multiple machines.
D.2. Creating Replicas
- The procedures and examples are not mutually exclusive; it is possible to use the CA, DNS, and other command-line options simultaneously. Examples in the following sections are called out separately to make it clearer what each configuration area requires.
- The
ipa-replica-installutility accepts a number of other options as well. For a complete list, the ipa-replica-install(1) man page.
D.2.1. Installing a Replica without DNS
- On the master IdM server, run the
ipa-replica-prepareutility and add the fully qualified domain name (FQDN) of the replica machine. Note that theipa-replica-preparescript does not validate the IP address or verify if the IP address of the replica is reachable by other servers.Important
The fully qualified domain name must be a valid DNS name, which means only numbers, alphabetic characters, and hyphens (-) are allowed. Other characters, like underscores, in the host name cause DNS failures. Additionally, the host name must be all lower-case; no capital letters are allowed.For other recommended naming practices, see the Red Hat Enterprise Linux Security Guide.If the master server is configured with integrated DNS, specify the IP address of the replica machine using the--ip-addressoption. The installation script then asks if you want to configure the reverse zone for the replica. Only pass--ip-addressif the IdM server was configured with integrated DNS. Otherwise, there is no DNS record to update, and the attempt to create the replica fails when the DNS record operation fails.Enter the initial master server's Directory Manager (DM) password when prompted. The output ofipa-replica-preparedisplays the location of the replica information file. For example:[root@server ~]# ipa-replica-prepare replica.example.com --ip-address 192.0.2.2 Directory Manager (existing master) password: Do you want to configure the reverse zone? [yes]: no Preparing replica for replica.example.com from server.example.com Creating SSL certificate for the Directory Server Creating SSL certificate for the dogtag Directory Server Saving dogtag Directory Server port Creating SSL certificate for the Web Server Exporting RA certificate Copying additional files Finalizing configuration Packaging replica information into /var/lib/ipa/replica-info-replica.example.com.gpg Adding DNS records for replica.example.com Waiting for replica.example.com. A or AAAA record to be resolvable This can be safely interrupted (Ctrl+C) The ipa-replica-prepare command was successfulWarning
Replica information files contain sensitive information. Take appropriate steps to ensure that they are properly protected.For other options that can be added toipa-replica-prepare, see the ipa-replica-prepare(1) man page. - On the replica machine, install the ipa-server package.
[root@replica ~]# yum install ipa-server
- Copy the replica information file from the initial server to the replica machine:
[root@server ~]# scp /var/lib/ipa/replica-info-replica.example.com.gpg root@replica:/var/lib/ipa/
- On the replica machine, run the
ipa-replica-installutility and add the location of the replication information file to start the replica initialization process. Enter the original master server's Directory Manager and admin passwords when prompted, and wait for the replica installation script to complete.[root@replica ~]# ipa-replica-install /var/lib/ipa/replica-info-replica.example.com.gpg Directory Manager (existing master) password: Run connection check to master Check connection from replica to remote master 'server.example.com': ... Connection from replica to master is OK. Start listening on required ports for remote master check Get credentials to log in to remote master admin@MASTER.EXAMPLE.COM password: Check SSH connection to remote master ... Connection from master to replica is OK. ... Configuring NTP daemon (ntpd) [1/4]: stopping ntpd [2/4]: writing configuration ... Restarting Directory server to apply updates [1/2]: stopping directory server [2/2]: starting directory server Done. Restarting the directory server Restarting the KDC Restarting the web server
Note
If the replica file being installed does not match the current host name, the replica installation script displays a warning message and asks for confirmation. In some cases, such as on multi-homed machines, you can confirm to continue with the mismatched host names.For command-line options that can be added toipa-replica-install, see the ipa-replica-prepare(1) man page. Note that one of the optionsipa-replica-installaccepts is the--ip-addressoption. When added toipa-replica-install,--ip-addressonly accepts IP addresses associated with the local interface.
D.2.2. Installing a Replica with DNS
ipa-replica-install:
--setup-dns--forwarder
[root@replica ~]# ipa-replica-install /var/lib/ipa/replica-info-replica.example.com.gpg --setup-dns --forwarder 198.51.100.0
ipa-replica-install, make sure proper DNS entries were created, and optionally add other DNS servers as backup servers. See Section 4.5.3, “Installing a Replica with DNS” for details.
D.2.3. Installing a Replica with Various CA Configurations
Warning
Installing a Replica from a Server with a Certificate System CA Installed
--setup-ca option to the ipa-replica-install utility. The --setup-ca option copies the CA configuration from the initial server's configuration.
[root@replica ~]# ipa-replica-install /var/lib/ipa/replica-info-replica.example.com.gpg --setup-ca
Installing a Replica from a Server without a Certificate System CA Installed
ipa-replica-prepare utility on the initial server:
--dirsrv-cert-file--dirsrv-pin--http-cert-file--http-pin
[root@server ~]# ipa-replica-prepare replica.example.com --dirsrv-cert-file /tmp/server.key --dirsrv-pin secret --http-cert-file /tmp/server.crt --http-cert-file /tmp/server.key --http-pin secret --dirsrv-cert-file /tmp/server.crt
D.2.4. Adding Additional Replication Agreements
ipa-replica-install creates an initial replication agreement between the master server and the replica. To connect the replica to other servers or replicas, add additional agreements using the ipa-replica-manage utility.
ipa-csreplica-manage utility.
D.3. Managing Replicas and Replication Agreements
Note
D.3.1. Explaining Replication Agreements
Note
ipa-replica-install script. See Chapter 4, Installing and Uninstalling Identity Management Replicas for details on installing the initial replica.
Types of Replication Agreements
- Replication agreements to replicate directory data, such as users, groups, and policies. You can manage these agreements using the
ipa-replica-manageutility. - Replication agreements to replicate certificate server data. You can manage these agreements using the
ipa-csreplica-manageutility. - Synchronization agreements to replicate user information with an Active Directory server. These agreements are not described in this guide. For documentation on synchronizing IdM and Active Directory, see the Windows Integration Guide.
ipa-replica-manage and ipa-csreplica-manage utilities use the same format and arguments. The following sections of this chapter describe the most notable replication management operations performed using these utilities. For detailed information about the utilities, see the ipa-replica-manage(1) and ipa-csreplica-manage(1) man pages.
D.3.2. Listing Replication Agreements
ipa-replica-manage list command:
- Run
ipa-replica-manage listwithout any arguments to list all replicas in the replication topology. In the output, locate the required replica:$ ipa-replica-manage list server1.example.com: master server2.example.com: master server3.example.com: master server4.example.com: master - Add the replica's host name to
ipa-replica-manage listto list the replication agreements.$ ipa-replica-manage list server1.example.com server2.example.com: replica server3.example.com: replica
The output displays the replicas to whichserver1.example.comsends updates.
ipa-csreplica-manage list command.
D.3.3. Creating and Removing Replication Agreements
Creating Replication Agreements
ipa-replica-manage connect command:
$ ipa-replica-manage connect server1.example.com server2.example.com
ipa-replica-manage connect, IdM creates a replication agreement between the local host and the specified server.
ipa-csreplica-manage connect command.
Removing Replication Agreements
ipa-replica-manage disconnect command:
$ ipa-replica-manage disconnect server1.example.com server4.example.com
ipa-replica-manage disconnect command only removes the replication agreement. It leaves both servers in the Identity Management replication topology. To remove all replication agreements and data related to a replica, use the ipa-replica-manage del command, which removes the replica entirely from the Identity Management domain.
$ ipa-replica-manage del server2.example.com
ipa-csreplica-manage disconnect command. Similarly, to remove all certificate replication agreements and data between two servers, use the ipa-csreplica-manage del command.
D.3.4. Initiating a Manual Replication Update
ipa-replica-manage force-sync command. The local host on which you run the command is the replica that receives the update. To specify the replica that sends the update, use the --from option.
$ ipa-replica-manage force-sync --from server1.example.com
ipa-csreplica-manage force-sync command.
D.3.5. Re-initializing a Replica
Note
ipa-replica-manage re-initialize command. The local host on which you run the command is the re-initialized replica. To specify the replica from which the data is obtained, use the --from option:
$ ipa-replica-manage re-initialize --from server1.example.com
ipa-csreplica-manage re-initialize command.
D.3.6. Removing a Replica
- List all replication agreements for the IdM domain. In the output, note the host name of the replica.
$ ipa-replica-manage list server1.example.com: master server2.example.com: master server3.example.com: master server4.example.com: master - Use the
ipa-replica-manage delcommand to remove all agreements configured for the replica as well as all data about the replica.$ ipa-replica-manage del server3.example.com
- If the replica was configured with its own CA, then also use the
ipa-csreplica-manage delcommand to remove all certificate server replication agreements.$ ipa-csreplica-manage del server3.example.com
Note
This step is only required if the replica itself was configured with an IdM CA. It is not required if only the master server or other replicas were configured with a CA. - Uninstall the IdM server package.
$ ipa-server-install --uninstall -U
D.4. Promoting a Replica to a Master CA Server
- Make sure the replica is configured to handle CA subsystem certificate renewal. See Section D.4.1, “Changing Which Server Handles Certificate Renewal”.
- Configure the replica to generate CRLs. See Section 6.5.2.2, “Changing Which Server Generates CRLs”.
D.4.1. Changing Which Server Handles Certificate Renewal
- On Red Hat Enterprise Linux 7.3 and later, use the
ipa config-show | grep "CA renewal master"command:$ ipa config-show | grep "CA renewal master" IPA CA renewal master: server.example.com
- On Red Hat Enterprise Linux 7.2 and earlier, use the
ldapsearchutility. In the following example, the renewal master isserver.example.com:$ ldapsearch -H ldap://$HOSTNAME -D 'cn=Directory Manager' -W -b 'cn=masters,cn=ipa,cn=etc,dc=example,dc=com' '(&(cn=CA)(ipaConfigString=caRenewalMaster))' dn Enter LDAP Password: # extended LDIF # # LDAPv3 # base <cn=masters,cn=ipa,cn=etc,dc=example,dc=com> with scope subtree # filter: (&(cn=CA)(ipaConfigString=caRenewalMaster)) # requesting: dn # # CA, server.example.com, masters, ipa, etc, example.com dn: cn=CA,cn=server.example.com,cn=masters,cn=ipa,cn=etc,dc=example,dc=com # search result search: 2 result: 0 Success # numResponses: 2 # numEntries: 1
ipa-csreplica-manage utility:
# ipa-csreplica-manage set-renewal-master
Appendix E. Revision History
| Revision History | |||
|---|---|---|---|
| Revision 7.0-43 | Mon Oct 29 2018 | ||
| |||
| Revision 7.0-42 | Tue Jun 26 2018 | ||
| |||
| Revision 7.0-41 | Fri Apr 23 2018 | ||
| |||
| Revision 7.0-40 | Fri Apr 6 2018 | ||
| |||
| Revision 7.0-39 | Wed Mar 14 2018 | ||
| |||
| Revision 7.0-38 | Wed Feb 28 2018 | ||
| |||
| Revision 7.0-37 | Mon Feb 12 2018 | ||
| |||
| Revision 7.0-36 | Mon Jan 29 2018 | ||
| |||
| Revision 7.0-35 | Fri Dec 15 2017 | ||
| |||
| Revision 7.0-34 | Mon Dec 4 2017 | ||
| |||
| Revision 7.0-33 | Mon Nov 20 2017 | ||
| |||
| Revision 7.0-32 | Mon Oct 9 2017 | ||
| |||
| Revision 7.0-31 | Tue Sep 12 2017 | ||
| |||
| Revision 7.0-30 | Mon Aug 28 2017 | ||
| |||
| Revision 7.0-29 | Tue Jul 18 2017 | ||
| |||
| Revision 7.0-28 | Mon Apr 24 2017 | ||
| |||
| Revision 7.0-27 | Mon Apr 10 2017 | ||
| |||
| Revision 7.0-26 | Mon Mar 27 2017 | ||
| |||
| Revision 7.0-25 | Mon Feb 27 2017 | ||
| |||
| Revision 7.0-24 | Wed Dec 7 2016 | ||
| |||
| Revision 7.0-23 | Tue Oct 18 2016 | ||
| |||
| Revision 7.0-22 | Fri Jul 29 2016 | ||
| |||
| Revision 7.0-21 | Thu Jul 28 2016 | ||
| |||
| Revision 7.0-19 | Tue Jun 28 2016 | ||
| |||
| Revision 7.0-18 | Fri Jun 10 2016 | ||
| |||
| Revision 7.0-17 | Fri May 27 2016 | ||
| |||
| Revision 7.0-16 | Thu Mar 24 2016 | ||
| |||
| Revision 7.0-15 | Thu Mar 03 2016 | ||
| |||
| Revision 7.0-14 | Tue Feb 09 2016 | ||
| |||
| Revision 7.0-13 | Thu Nov 19 2015 | ||
| |||
| Revision 7.0-12 | Fri Nov 13 2015 | ||
| |||
| Revision 7.0-11 | Thu Nov 12 2015 | ||
| |||
| Revision 7.0-10 | Fri Mar 13 2015 | ||
| |||
| Revision 7.0-8 | Wed Feb 25 2015 | ||
| |||
| Revision 7.0-6 | Fri Dec 05 2014 | ||
| |||
| Revision 7.0-4 | Wed Jun 11 2014 | ||
| |||


