Ce contenu n'est pas disponible dans la langue sélectionnée.
Using external Red Hat utilities with Identity Management
Integrating services and Red Hat products in IdM
Abstract
Providing feedback on Red Hat documentation Copier lienLien copié sur presse-papiers!
We are committed to providing high-quality documentation and value your feedback. To help us improve, you can submit suggestions or report errors through the Red Hat Jira tracking system.
Procedure
Log in to the Jira website.
If you do not have an account, select the option to create one.
- Click Create in the top navigation bar.
- Enter a descriptive title in the Summary field.
- Enter your suggestion for improvement in the Description field. Include links to the relevant parts of the documentation.
- Click Create at the bottom of the dialogue.
Chapter 1. IdM integration with Red Hat products Copier lienLien copié sur presse-papiers!
Find documentation for other Red Hat products that integrate with IdM. You can configure these products to allow your IdM users to access their services.
Chapter 2. Using external identity providers to authenticate to IdM Copier lienLien copié sur presse-papiers!
You can associate users with external identity providers (IdP) that support the OAuth 2.0 device authorization flow. When these users authenticate with the System Security Services Daemon (SSSD) version available in RHEL 9.1 or later, they receive RHEL Identity Management (IdM) single sign-on capabilities with Kerberos tickets after performing authentication and authorization at the external IdP.
Notable features include:
-
Adding, modifying, and deleting references to external IdPs with
ipa idp-*commands. -
Enabling IdP authentication for users with the
ipa user-mod --user-auth-type=idpcommand.
What is supported:
-
Logging in remotely via Secure Shell (SSH) with the
keyboard-interactiveauthentication method enabled, which allows calling Pluggable Authentication Module (PAM) libraries. -
Logging in locally with the console via the
logindservice. -
Retrieving a Kerberos TGT with the
kinitutility.
What is currently not supported:
- Logging in to the IdM WebUI directly. To log in to the IdM WebUI, you must first acquire a Kerberos ticket.
- Logging in to Cockpit WebUI directly. To log in to the Cockpit WebUI, you must first acquire a Kerberos ticket.
2.1. The benefits of connecting IdM to an external IdP Copier lienLien copié sur presse-papiers!
As an administrator, you might want to allow users stored in an external identity source, such as a cloud services provider, to access RHEL systems joined to your Identity Management (IdM) environment. To achieve this, you can delegate the authentication and authorization process of issuing Kerberos tickets for these users to that external entity.
You can use this feature to expand IdM’s capabilities and allow users stored in external identity providers (IdPs) to access Linux systems managed by IdM.
2.2. How IdM incorporates logins via external IdPs Copier lienLien copié sur presse-papiers!
SSSD 2.7.0 contains the sssd-idp package, which implements the idp Kerberos pre-authentication method. This authentication method follows the OAuth 2.0 Device Authorization Grant flow to delegate authorization decisions to external IdPs:
-
An IdM client user initiates OAuth 2.0 Device Authorization Grant flow, for example, by attempting to retrieve a Kerberos Ticket Granting Ticket (TGT) with the
kinitutility at the command line. - A special code and website link are sent from the Authorization Server to the IdM Key Distribution Center (KDC) backend.
- The IdM client displays the link and the code to the user. In this example, the IdM client outputs the link and code on the command line.
The user opens the website link in a browser, which can be on another host, a mobile phone, and so on:
- The user enters the special code.
- If necessary, the user logs in to the OAuth 2.0-based IdP.
- The user is prompted to authorize the client to access information.
- The user confirms access at the original device prompt. In this example, the user hits the Enter key at the command line.
- The IdM KDC backend polls the OAuth 2.0 Authorization Server for access to user information.
2.3. Creating a reference to an external identity provider Copier lienLien copié sur presse-papiers!
To connect external identity providers (IdPs) to your Identity Management (IdM) environment, create IdP references in IdM. Complete this procedure to create a reference called my-keycloak-idp to an IdP based on the Keycloak template. For more reference templates, see Example references to different external IdPs in IdM.
Prerequisites
- You have registered IdM as an OAuth application to your external IdP, and obtained a client ID.
- You can authenticate as the IdM admin account.
- Your IdM servers are using RHEL 9.1 or later.
- Your IdM servers are using SSSD 2.7.0 or later.
Procedure
Authenticate as the IdM admin on an IdM server.
kinit admin
[root@server ~]# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a reference called
my-keycloak-idpto an IdP based on the Keycloak template, where the--base-urloption specifies the URL to the Keycloak server in the formatserver-name.$DOMAIN:$PORT/prefix.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the output of the
ipa idp-showcommand shows the IdP reference you have created.ipa idp-show my-keycloak-idp
[root@server ~]# ipa idp-show my-keycloak-idpCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. Example references to different external IdPs in IdM Copier lienLien copié sur presse-papiers!
The following table lists examples of the ipa idp-add command for creating references to different IdPs in IdM.
| Identity Provider | Important options | Command example |
|---|---|---|
|
Microsoft Identity Platform, |
|
ipa idp-add my-azure-idp \ --provider microsoft \ --organization main \ --client-id <azure_client_id>
|
| |
|
ipa idp-add my-google-idp \ --provider google \ --client-id <google_client_id>
|
| GitHub |
|
ipa idp-add my-github-idp \ --provider github \ --client-id <github_client_id>
|
|
Keycloak, |
|
ipa idp-add my-keycloak-idp \ --provider keycloak \ --organization main \ --base-url keycloak.idm.example.com:8443/auth \ --client-id <keycloak_client_id>
Note
The Quarkus version of Keycloak 17 and later have removed the |
| Okta |
|
ipa idp-add my-okta-idp \ --provider okta --base-url dev-12345.okta.com \ --client-id <okta_client_id>
|
2.5. Options for the ipa idp-* commands to manage external identity providers in IdM Copier lienLien copié sur presse-papiers!
The following examples show how to configure references to external IdPs based on the different IdP templates. Use the following options to specify your settings:
--provider- The predefined template for one of the known identity providers.
--client-id- The OAuth 2.0 client identifier issued by the IdP during application registration. As the application registration procedure is specific to each IdP, refer to their documentation for details. If the external IdP is Red Hat Single Sign-On (SSO), see Creating an OpenID Connect Client.
--base-url- Base URL for IdP templates, required by Keycloak and Okta.
--organization- Domain or Organization ID from the IdP, required by Microsoft Azure.
--secretOptional: Use this option if you have configured your external IdP to require a secret from confidential OAuth 2.0 clients. If you use this option when creating an IdP reference, you are prompted for the secret interactively. Protect the client secret as a password.
NoteSSSD in RHEL 9.1 only supports non-confidential OAuth 2.0 clients that do not use a client secret. If you want to use external IdPs that require a client secret from confidential clients, you must use SSSD in RHEL 9.2 and later.
2.6. Managing references to external IdPs Copier lienLien copié sur presse-papiers!
After you have created a reference to an external identity provider (IdP), you can find, show, modify, and delete that reference. This example shows you how to manage a reference to an external IdP named keycloak-server1.
Prerequisites
- You can authenticate as the IdM admin account.
- Your IdM servers are using RHEL 9.1 or later.
- Your IdM servers are using SSSD 2.7.0 or later.
- You have created a reference to an external IdP in IdM. See Creating a reference to an external identity provider.
Procedure
Authenticate as the IdM admin on an IdM server.
kinit admin
[root@server ~]# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Manage the IdP reference.
To find an IdP reference whose entry includes the string
keycloak:ipa idp-find keycloak
[root@server ~]# ipa idp-find keycloakCopy to Clipboard Copied! Toggle word wrap Toggle overflow To display an IdP reference named
my-keycloak-idp:ipa idp-show my-keycloak-idp
[root@server ~]# ipa idp-show my-keycloak-idpCopy to Clipboard Copied! Toggle word wrap Toggle overflow To modify an IdP reference, use the
ipa idp-modcommand. For example, to change the secret for an IdP reference namedmy-keycloak-idp, specify the--secretoption to be prompted for the secret:ipa idp-mod my-keycloak-idp --secret
[root@server ~]# ipa idp-mod my-keycloak-idp --secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow To delete an IdP reference named
my-keycloak-idp:ipa idp-del my-keycloak-idp
[root@server ~]# ipa idp-del my-keycloak-idpCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.7. Enabling an IdM user to authenticate via an external IdP Copier lienLien copié sur presse-papiers!
To enable an IdM user to authenticate via an external identity provider (IdP), associate the external IdP reference you have previously created with the user account. This example associates the external IdP reference keycloak-server1 with the user idm-user-with-external-idp.
Prerequisites
- Your IdM client and IdM servers are using RHEL 9.1 or later.
- Your IdM client and IdM servers are using SSSD 2.7.0 or later.
- You have created a reference to an external IdP in IdM. See Creating a reference to an external identity provider.
Procedure
Modify the IdM user entry to associate an IdP reference with the user account:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the output of the
ipa user-showcommand for that user displays references to the IdP:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.8. Retrieving an IdM ticket-granting ticket as an external IdP user Copier lienLien copié sur presse-papiers!
If you have delegated authentication for an Identity Management (IdM) user to an external identity provider (IdP), the IdM user can request a Kerberos ticket-granting ticket (TGT) by authenticating to the external IdP.
Complete this procedure to:
- Retrieve and store an anonymous Kerberos ticket locally.
-
Request the TGT for the idm-user-with-external-idp user by using
kinitwith the-Toption to enable Flexible Authentication via Secure Tunneling (FAST) channel to provide a secure connection between the Kerberos client and Kerberos Distribution Center (KDC).
Prerequisites
- Your IdM client and IdM servers use RHEL 9.1 or later.
- Your IdM client and IdM servers use SSSD 2.7.0 or later.
- You have created a reference to an external IdP in IdM. See Creating a reference to an external identity provider.
- You have associated an external IdP reference with the user account. See Enabling an IdM user to authenticate via an external IdP.
- The user that you are initially logged in as has write permissions on a directory in the local filesystem.
Procedure
Use Anonymous PKINIT to obtain a Kerberos ticket and store it in a file named
./fast.ccache.kinit -n -c ./fast.ccache
$ kinit -n -c ./fast.ccacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: View the retrieved ticket:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Begin authenticating as the IdM user, using the
-Toption to enable the FAST communication channel.kinit -T ./fast.ccache idm-user-with-external-idp Authenticate at https://oauth2.idp.com:8443/auth/realms/master/device?user_code=YHMQ-XKTL and press ENTER.:
[root@client ~]# kinit -T ./fast.ccache idm-user-with-external-idp Authenticate at https://oauth2.idp.com:8443/auth/realms/master/device?user_code=YHMQ-XKTL and press ENTER.:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In a browser, authenticate as the user at the website provided in the command output.
- At the command line, press the Enter key to finish the authentication process.
Verification
Display your Kerberos ticket information and confirm that the line
config: pa_typeshows152for pre-authentication with an external IdP.Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
pa_type = 152indicates external IdP authentication.
2.9. Logging in to an IdM client via SSH as an external IdP user Copier lienLien copié sur presse-papiers!
To log in to an IdM client via SSH as an external identity provider (IdP) user, begin the login process on the command linel. When prompted, perform the authentication process at the website associated with the IdP, and finish the process at the Identity Management (IdM) client.
Prerequisites
- Your IdM client and IdM servers are using RHEL 9.1 or later.
- Your IdM client and IdM servers are using SSSD 2.7.0 or later.
- You have created a reference to an external IdP in IdM. See Creating a reference to an external identity provider.
- You have associated an external IdP reference with the user account. See Enabling an IdM user to authenticate via an external IdP.
Procedure
Attempt to log in to the IdM client via SSH.
ssh idm-user-with-external-idp@client.idm.example.com (idm-user-with-external-idp@client.idm.example.com) Authenticate at https://oauth2.idp.com:8443/auth/realms/main/device?user_code=XYFL-ROYR and press ENTER.
[user@client ~]$ ssh idm-user-with-external-idp@client.idm.example.com (idm-user-with-external-idp@client.idm.example.com) Authenticate at https://oauth2.idp.com:8443/auth/realms/main/device?user_code=XYFL-ROYR and press ENTER.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In a browser, authenticate as the user at the website provided in the command output.
- At the command line, press the Enter key to finish the authentication process.
Verification
Display your Kerberos ticket information and confirm that the line
config: pa_typeshows152for pre-authentication with an external IdP.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.10. The --provider option in the ipa idp-* commands Copier lienLien copié sur presse-papiers!
The following identity providers (IdPs) support OAuth 2.0 device authorization grant flow:
- Microsoft Identity Platform, including Azure AD
- GitHub
- Keycloak, including Red Hat Single Sign-On (SSO)
- Okta
When using the ipa idp-add command to create a reference to one of these external IdPs, you can specify the IdP type with the --provider option, which expands into additional options as described below:
--provider=microsoftMicrosoft Azure IdPs allow parametrization based on the Azure tenant ID, which you can specify with the
--organizationoption to theipa idp-addcommand. If you need support for the live.com IdP, specify the option--organization common.Choosing
--provider=microsoftexpands to use the following options. The value of the--organizationoption replaces the string${ipaidporg}in the table.Expand Option Value --auth-uri=URIhttps://login.microsoftonline.com/${ipaidporg}/oauth2/v2.0/authorize--dev-auth-uri=URIhttps://login.microsoftonline.com/${ipaidporg}/oauth2/v2.0/devicecode--token-uri=URIhttps://login.microsoftonline.com/${ipaidporg}/oauth2/v2.0/token--userinfo-uri=URIhttps://graph.microsoft.com/oidc/userinfo--keys-uri=URIhttps://login.microsoftonline.com/common/discovery/v2.0/keys--scope=STRopenid email--idp-user-id=STRemail--provider=googleChoosing
--provider=googleexpands to use the following options:Expand Option Value --auth-uri=URIhttps://accounts.google.com/o/oauth2/auth--dev-auth-uri=URIhttps://oauth2.googleapis.com/device/code--token-uri=URIhttps://oauth2.googleapis.com/token--userinfo-uri=URIhttps://openidconnect.googleapis.com/v1/userinfo--keys-uri=URIhttps://www.googleapis.com/oauth2/v3/certs--scope=STRopenid email--idp-user-id=STRemail--provider=githubChoosing
--provider=githubexpands to use the following options:Expand Option Value --auth-uri=URIhttps://github.com/login/oauth/authorize--dev-auth-uri=URIhttps://github.com/login/device/code--token-uri=URIhttps://github.com/login/oauth/access_token--userinfo-uri=URIhttps://openidconnect.googleapis.com/v1/userinfo--keys-uri=URIhttps://api.github.com/user--scope=STRuser--idp-user-id=STRlogin--provider=keycloakWith Keycloak, you can define multiple realms or organizations. Since it is often a part of a custom deployment, both base URL and realm ID are required, and you can specify them with the
--base-urland--organizationoptions to theipa idp-addcommand:ipa idp-add MySSO --provider keycloak \ --org main --base-url keycloak.domain.com:8443/auth \ --client-id <your-client-id>
[root@client ~]# ipa idp-add MySSO --provider keycloak \ --org main --base-url keycloak.domain.com:8443/auth \ --client-id <your-client-id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Choosing
--provider=keycloakexpands to use the following options. The value you specify in the--base-urloption replaces the string${ipaidpbaseurl}in the table, and the value you specify for the--organization `option replaces the string `${ipaidporg}.Expand Option Value --auth-uri=URIhttps://${ipaidpbaseurl}/realms/${ipaidporg}/protocol/openid-connect/auth--dev-auth-uri=URIhttps://${ipaidpbaseurl}/realms/${ipaidporg}/protocol/openid-connect/auth/device--token-uri=URIhttps://${ipaidpbaseurl}/realms/${ipaidporg}/protocol/openid-connect/token--userinfo-uri=URIhttps://${ipaidpbaseurl}/realms/${ipaidporg}/protocol/openid-connect/userinfo--scope=STRopenid email--idp-user-id=STRemail--provider=oktaAfter registering a new organization in Okta, a new base URL is associated with it. You can specify this base URL with the
--base-urloption to theipa idp-addcommand:ipa idp-add MyOkta --provider okta --base-url dev-12345.okta.com --client-id <your-client-id>
[root@client ~]# ipa idp-add MyOkta --provider okta --base-url dev-12345.okta.com --client-id <your-client-id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Choosing
--provider=oktaexpands to use the following options. The value you specify for the--base-urloption replaces the string${ipaidpbaseurl}in the table.Expand Option Value --auth-uri=URIhttps://${ipaidpbaseurl}/oauth2/v1/authorize--dev-auth-uri=URIhttps://${ipaidpbaseurl}/oauth2/v1/device/authorize--token-uri=URIhttps://${ipaidpbaseurl}/oauth2/v1/token--userinfo-uri=URIhttps://${ipaidpbaseurl}/oauth2/v1/userinfo--scope=STRopenid email--idp-user-id=STRemail
Chapter 3. Setting up Samba on an IdM domain member Copier lienLien copié sur presse-papiers!
You can set up Samba on a host that is joined to a Red Hat Identity Management (IdM) domain. Users from IdM and also, if available, from trusted Active Directory (AD) domains, can access shares and printer services provided by Samba.
Using Samba on an IdM domain member is an unsupported Technology Preview feature and contains certain limitations. For example, IdM trust controllers do not support the Active Directory Global Catalog service, and they do not support resolving IdM groups using the Distributed Computing Environment / Remote Procedure Calls (DCE/RPC) protocols. As a consequence, AD users can only access Samba shares and printers hosted on IdM clients when logged in to other IdM clients; AD users logged into a Windows machine cannot access Samba shares hosted on an IdM domain member.
Customers deploying Samba on IdM domain members are encouraged to provide feedback to Red Hat.
If users from AD domains need to access shares and printer services provided by Samba, ensure the AES encryption type is enabled is AD. For more information, see Enabling the AES encryption type in Active Directory using a GPO.
Prerequisites
- The host is joined as a client to the IdM domain.
- Both the IdM servers and the client must run on RHEL 9.0 or later.
3.1. Preparing the IdM domain for installing Samba on domain members Copier lienLien copié sur presse-papiers!
Before you can set up Samba on an IdM client, you must prepare the IdM domain using the ipa-adtrust-install utility on an IdM server.
Any system where you run the ipa-adtrust-install command automatically becomes an AD trust controller. However, you must run ipa-adtrust-install only once on an IdM server.
Prerequisites
- IdM server is installed.
- You have root privileges to install packages and restart IdM services.
Procedure
Install the required packages:
dnf install ipa-server-trust-ad samba-client
[root@ipaserver ~]# dnf install ipa-server-trust-ad samba-clientCopy to Clipboard Copied! Toggle word wrap Toggle overflow Authenticate as the IdM administrative user:
kinit admin
[root@ipaserver ~]# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
ipa-adtrust-installutility:ipa-adtrust-install
[root@ipaserver ~]# ipa-adtrust-installCopy to Clipboard Copied! Toggle word wrap Toggle overflow The DNS service records are created automatically if IdM was installed with an integrated DNS server.
If you installed IdM without an integrated DNS server,
ipa-adtrust-installprints a list of service records that you must manually add to DNS before you can continue.The script prompts you that the
/etc/samba/smb.confalready exists and will be rewritten:WARNING: The smb.conf already exists. Running ipa-adtrust-install will break your existing Samba configuration. Do you wish to continue? [no]: yes
WARNING: The smb.conf already exists. Running ipa-adtrust-install will break your existing Samba configuration. Do you wish to continue? [no]: yesCopy to Clipboard Copied! Toggle word wrap Toggle overflow The script prompts you to configure the
slapi-nisplug-in, a compatibility plug-in that allows older Linux clients to work with trusted users:Do you want to enable support for trusted domains in Schema Compatibility plugin? This will allow clients older than SSSD 1.9 and non-Linux clients to work with trusted users. Enable trusted domains support in slapi-nis? [no]: yes
Do you want to enable support for trusted domains in Schema Compatibility plugin? This will allow clients older than SSSD 1.9 and non-Linux clients to work with trusted users. Enable trusted domains support in slapi-nis? [no]: yesCopy to Clipboard Copied! Toggle word wrap Toggle overflow You are prompted to run the SID generation task to create a SID for any existing users:
Do you want to run the ipa-sidgen task? [no]: yes
Do you want to run the ipa-sidgen task? [no]: yesCopy to Clipboard Copied! Toggle word wrap Toggle overflow This is a resource-intensive task, so if you have a high number of users, you can run this at another time.
Optional: By default, the Dynamic RPC port range is defined as
49152-65535for Windows Server 2008 and later. If you need to define a different Dynamic RPC port range for your environment, configure Samba to use different ports and open those ports in your firewall settings. The following example sets the port range to55000-65000.net conf setparm global 'rpc server dynamic port range' 55000-65000 firewall-cmd --add-port=55000-65000/tcp firewall-cmd --runtime-to-permanent
[root@ipaserver ~]# net conf setparm global 'rpc server dynamic port range' 55000-65000 [root@ipaserver ~]# firewall-cmd --add-port=55000-65000/tcp [root@ipaserver ~]# firewall-cmd --runtime-to-permanentCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the
ipaservice:ipactl restart
[root@ipaserver ~]# ipactl restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
smbclientutility to verify that Samba responds to Kerberos authentication from the IdM side:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Installing and configuring a Samba server on an IdM client Copier lienLien copié sur presse-papiers!
You can install and configure Samba on a client enrolled in an IdM domain.
Prerequisites
- Both the IdM servers and the client must run on RHEL 9.0 or later.
- The IdM domain is prepared as described in Preparing the IdM domain for installing Samba on domain members.
- If IdM has a trust configured with AD, enable the AES encryption type for Kerberos. For example, use a group policy object (GPO) to enable the AES encryption type. For details, see Enabling AES encryption in Active Directory using a GPO.
Procedure
Install the
ipa-client-sambapackage:dnf install ipa-client-samba
[root@idm_client]# dnf install ipa-client-sambaCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
ipa-client-sambautility to prepare the client and create an initial Samba configuration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow By default,
ipa-client-sambaautomatically adds the[homes]section to the/etc/samba/smb.conffile that dynamically shares a user’s home directory when the user connects. If users do not have home directories on this server, or if you do not want to share them, remove the following lines from/etc/samba/smb.conf:[homes] read only = no[homes] read only = noCopy to Clipboard Copied! Toggle word wrap Toggle overflow Share directories and printers. For details, see the following sections:
Open the ports required for a Samba client in the local firewall:
firewall-cmd --permanent --add-service=samba-client firewall-cmd --reload
[root@idm_client]# firewall-cmd --permanent --add-service=samba-client [root@idm_client]# firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the
smbandwinbindservices:systemctl enable --now smb winbind
[root@idm_client]# systemctl enable --now smb winbindCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Run the following verification step on a different IdM domain member that has the samba-client package installed:
List the shares on the Samba server using Kerberos authentication:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3. Manually adding an ID mapping configuration if IdM trusts a new domain Copier lienLien copié sur presse-papiers!
Samba requires an ID mapping configuration for each domain from which users access resources. On an existing Samba server running on an IdM client, you must manually add an ID mapping configuration after the administrator added a new trust to an Active Directory (AD) domain.
Prerequisites
- You configured Samba on an IdM client. Afterward, a new trust was added to IdM.
- The DES and RC4 encryption types for Kerberos must be disabled in the trusted AD domain. For security reasons, RHEL 9 does not support these weak encryption types.
Procedure
Authenticate using the host’s keytab:
kinit -k
[root@idm_client]# kinit -kCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
ipa idrange-findcommand to display both the base ID and the ID range size of the new domain. For example, the following command displays the values for thead.example.comdomain:Copy to Clipboard Copied! Toggle word wrap Toggle overflow You need the values from the
ipabaseidandipaidrangesizeattributes in the next steps.To calculate the highest usable ID, use the following formula:
maximum_range = ipabaseid + ipaidrangesize - 1
maximum_range = ipabaseid + ipaidrangesize - 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow With the values from the previous step, the highest usable ID for the
ad.example.comdomain is1918599999(1918400000 + 200000 - 1).Edit the
/etc/samba/smb.conffile, and add the ID mapping configuration for the domain to the[global]section:idmap config AD : range = 1918400000 - 1918599999 idmap config AD : backend = sss
idmap config AD : range = 1918400000 - 1918599999 idmap config AD : backend = sssCopy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the value from
ipabaseidattribute as the lowest and the computed value from the previous step as the highest value of the range.Restart the
smbandwinbindservices:systemctl restart smb winbind
[root@idm_client]# systemctl restart smb winbindCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
List the shares on the Samba server using Kerberos authentication:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 4. Migrating from NIS to Identity Management Copier lienLien copié sur presse-papiers!
A Network Information Service (NIS) server can contain information about users, groups, hosts, netgroups and automount maps. As a system administrator you can migrate these entry types, authentication, and authorization from NIS server to an Identity Management (IdM) server so that all user management operations are performed on the IdM server. Migrating from NIS to IdM will also allow you access to more secure protocols such as Kerberos.
4.1. Enabling NIS in IdM Copier lienLien copié sur presse-papiers!
To allow communication between NIS and Identity Management (IdM) server, you must enable NIS compatibility options on IdM server.
Prerequisites
- You have root access on IdM server.
Procedure
Enable the NIS listener and compatibility plug-ins on IdM server:
ipa-nis-manage enable ipa-compat-manage enable
[root@ipaserver ~]# ipa-nis-manage enable [root@ipaserver ~]# ipa-compat-manage enableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: For a more strict firewall configuration, set a fixed port.
For example, to set the port to unused port
514:ldapmodify -x -D 'cn=directory manager' -W dn: cn=NIS Server,cn=plugins,cn=config changetype: modify add: nsslapd-pluginarg0 nsslapd-pluginarg0: 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: 514Copy to Clipboard Copied! Toggle word wrap Toggle overflow WarningTo avoid conflict with other services do not use any port number above 1024.
Enable and start the port mapper service:
systemctl enable rpcbind.service systemctl start rpcbind.service
[root@ipaserver ~]# systemctl enable rpcbind.service [root@ipaserver ~]# systemctl start rpcbind.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart Directory Server:
systemctl restart dirsrv.target
[root@ipaserver ~]# systemctl restart dirsrv.targetCopy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2. Migrating user entries from NIS to IdM Copier lienLien copié sur presse-papiers!
The NIS 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 Identity Management (IdM):
Prerequisites
- You have root access on NIS server.
- NIS is enabled in IdM.
- The NIS server is enrolled into IdM.
- You have ID ranges that can store UIDs of importing users.
Procedure
Install the
yp-toolspackage:dnf install yp-tools -y
[root@nis-server ~]# dnf install yp-tools -yCopy to Clipboard Copied! Toggle word wrap Toggle overflow On the NIS server create the
/root/nis-users.shscript with the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Authenticate as the IdM
adminuser:kinit admin
[root@nis-server ~]# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the script. For example:
sh /root/nis-users.sh nisdomain nis-server.example.com
[root@nis-server ~]# sh /root/nis-users.sh nisdomain nis-server.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantThis script uses hard-coded values for first name, last name, and sets the password to
passw0rd1. The user must change the temporary password at the next login.
4.3. Migrating user group from NIS to IdM Copier lienLien copié sur presse-papiers!
The NIS group map contains information about groups, such as group names, GIDs, or group members. Use this data to migrate NIS groups to Identity Management (IdM):
Prerequisites
- You have root access on NIS server.
- NIS is enabled in IdM.
- The NIS server is enrolled into IdM.
Procedure
Install the
yp-toolspackage:dnf install yp-tools -y
[root@nis-server ~]# dnf install yp-tools -yCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
/root/nis-groups.shscript with the following content on the NIS server:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteMake sure your usernames do not contain any special characters to ensure successful migration of the user group.
Authenticate as the IdM
adminuser:kinit admin
[root@nis-server ~]# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the script. For example:
sh /root/nis-groups.sh nisdomain nis-server.example.com
[root@nis-server ~]# sh /root/nis-groups.sh nisdomain nis-server.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow
4.4. Migrating host entries from NIS to IdM Copier lienLien copié sur presse-papiers!
The NIS hosts map contains information about hosts, such as host names and IP addresses. Use this data to migrate NIS host entries to Identity Management (IdM):
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 the ipa netgroup-* commands only to manage native netgroups created via the netgroup-add command.
Prerequisites
- You have root access on NIS server.
- NIS is enabled in IdM.
- The NIS server is enrolled into IdM.
Procedure
Install the
yp-toolspackage:dnf install yp-tools -y
[root@nis-server ~]# dnf install yp-tools -yCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
/root/nis-hosts.shscript with the following content on the NIS server:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Authenticate as the IdM
adminuser:kinit admin
[root@nis-server ~]# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the script. For example:
sh /root/nis-hosts.sh nisdomain nis-server.example.com
[root@nis-server ~]# sh /root/nis-hosts.sh nisdomain nis-server.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThis script does not migrate special host configurations, such as aliases.
4.5. Migrating netgroup entries from NIS to IdM Copier lienLien copié sur presse-papiers!
The NIS netgroup map contains information about netgroups. Use this data to migrate NIS netgroups to Identity Management (IdM):
Prerequisites
- You have root access on NIS server.
- NIS is enabled in IdM.
- The NIS server is enrolled into IdM.
Procedure
Install the
yp-toolspackage:dnf install yp-tools -y
[root@nis-server ~]# dnf install yp-tools -yCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
/root/nis-netgroups.shscript with the following content on the NIS server:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Authenticate as the IdM
adminuser:kinit admin
[root@nis-server ~]# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the script. For example:
sh /root/nis-netgroups.sh nisdomain nis-server.example.com
[root@nis-server ~]# sh /root/nis-netgroups.sh nisdomain nis-server.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow
4.6. Migrating automount maps from NIS to IdM Copier lienLien copié sur presse-papiers!
Automount maps are a series of nested and interrelated entries that define the location (the parent entry), the associated keys, and maps. To migrate NIS automount maps to Identity Management (IdM):
Prerequisites
- You have root access on NIS server.
- NIS is enabled in IdM.
- The NIS server is enrolled into IdM.
Procedure
Install the
yp-toolspackage:dnf install yp-tools -y
[root@nis-server ~]# dnf install yp-tools -yCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
/root/nis-automounts.shscript with the following content on the NIS server:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe 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.
Authenticate as the IdM
adminuser:kinit admin
[root@nis-server ~]# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the script. For example:
sh /root/nis-automounts.sh location nisdomain nis-server.example.com map_name[root@nis-server ~]# sh /root/nis-automounts.sh location nisdomain nis-server.example.com map_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 5. Using automount in IdM Copier lienLien copié sur presse-papiers!
Automount is a way to manage, organize, and access directories across multiple systems. Automount automatically mounts a directory whenever access to it is requested. This works well within an Identity Management (IdM) domain as it allows you to share directories on clients within the domain easily.
The example uses the following scenario:
- nfs-server.idm.example.com is the fully-qualified domain name (FQDN) of a Network File System (NFS) server.
For the sake of simplicity, nfs-server.idm.example.com is an IdM client that provides the maps for the raleigh automount location.
NoteAn automount location is a unique set of NFS maps. Ideally, these maps are all located in the same geographical region so that, for example, the clients can benefit from fast connections, but this is not mandatory.
- The NFS server exports the /exports/project directory as read-write.
- Any IdM user belonging to the developers group can access the contents of the exported directory as /devel/project/ on any IdM client that uses the raleigh automount location.
- idm-client.idm.example.com is an IdM client that uses the raleigh automount location.
If you want to use a Samba server instead of an NFS server to provide the shares for IdM clients, see the Red Hat Knowledgebase solution How do I configure kerberized CIFS mounts with Autofs in an IPA environment?.
5.1. Autofs and automount in IdM Copier lienLien copié sur presse-papiers!
The autofs service automates the mounting of directories, as needed, by directing the automount daemon to mount directories when they are accessed. In addition, after a period of inactivity, autofs directs automount to unmount auto-mounted directories. Unlike static mounting, on-demand mounting saves system resources.
- Automount maps
On a system that utilizes
autofs, theautomountconfiguration is stored in several different files. The primaryautomountconfiguration file is/etc/auto.master, which contains the master mapping ofautomountmount points, and their associated resources, on a system. This mapping is known as automount maps.The
/etc/auto.masterconfiguration file contains the master map. It can contain references to other maps. These maps can either be direct or indirect. Direct maps use absolute path names for their mount points, while indirect maps use relative path names.- Automount configuration in IdM
While
automounttypically retrieves its map data from the local/etc/auto.masterand associated files, it can also retrieve map data from other sources. One common source is an LDAP server. In the context of Identity Management (IdM), this is a 389 Directory Server.If a system that uses
autofsis a client in an IdM domain, theautomountconfiguration is not stored in local configuration files. Instead, theautofsconfiguration, such as maps, locations, and keys, is stored as LDAP entries in the IdM directory. For example, for theidm.example.comIdM domain, the default master map is stored as follows:dn: automountmapname=auto.master,cn=default,cn=automount,dc=idm,dc=example,dc=com objectClass: automountMap objectClass: top automountMapName: auto.master
dn: automountmapname=auto.master,cn=default,cn=automount,dc=idm,dc=example,dc=com objectClass: automountMap objectClass: top automountMapName: auto.masterCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Setting up an NFS server with Kerberos in a Red Hat Enterprise Linux Identity Management domain Copier lienLien copié sur presse-papiers!
If you use Red Hat Enterprise Linux Identity Management (IdM), you can join your NFS server to the IdM domain. This enables you to centrally manage users and groups and to use Kerberos for authentication, integrity protection, and traffic encryption.
Prerequisites
- The NFS server is enrolled in a Red Hat Enterprise Linux Identity Management (IdM) domain.
- The NFS server is running and configured.
Procedure
Obtain a kerberos ticket as an IdM administrator:
kinit admin
# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
nfs/<FQDN>service principal:ipa service-add nfs/nfs_server.idm.example.com
# ipa service-add nfs/nfs_server.idm.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the
nfsservice principal from IdM, and store it in the/etc/krb5.keytabfile:ipa-getkeytab -s idm_server.idm.example.com -p nfs/nfs_server.idm.example.com -k /etc/krb5.keytab
# ipa-getkeytab -s idm_server.idm.example.com -p nfs/nfs_server.idm.example.com -k /etc/krb5.keytabCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Display the principals in the
/etc/krb5.keytabfile:Copy to Clipboard Copied! Toggle word wrap Toggle overflow By default, the IdM client adds the host principal to the
/etc/krb5.keytabfile when you join the host to the IdM domain. If the host principal is missing, use theipa-getkeytab -s idm_server.idm.example.com -p host/nfs_server.idm.example.com -k /etc/krb5.keytabcommand to add it.Use the
ipa-client-automountutility to configure mapping of IdM IDs:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update your
/etc/exportsfile, and add the Kerberos security method to the client options. For example:/nfs/projects/ 192.0.2.0/24(rw,sec=krb5i)
/nfs/projects/ 192.0.2.0/24(rw,sec=krb5i)Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you want that your clients can select from multiple security methods, specify them separated by colons:
/nfs/projects/ 192.0.2.0/24(rw,sec=krb5:krb5i:krb5p)
/nfs/projects/ 192.0.2.0/24(rw,sec=krb5:krb5i:krb5p)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reload the exported file systems:
exportfs -r
# exportfs -rCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.3. Configuring automount locations and maps in IdM using the IdM CLI Copier lienLien copié sur presse-papiers!
A location is a set of maps, which are all stored in auto.master. 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.
As a system administrator in Identity Management (IdM), you can configure automount locations and maps in IdM so that IdM users in the specified locations can access shares exported by an NFS server by navigating to specific mount points on their hosts. Both the exported NFS server directory and the mount points are specified in the maps. The example describes how to configure the raleigh location and a map that mounts the nfs-server.idm.example.com:/exports/project share on the /devel/ mount point on the IdM client as a read-write directory.
Prerequisites
- You are logged in as an IdM administrator on any IdM-enrolled host.
Procedure
Create the raleigh automount location:
ipa automountlocation-add raleigh ---------------------------------- Added automount location "raleigh" ---------------------------------- Location: raleigh
$ ipa automountlocation-add raleigh ---------------------------------- Added automount location "raleigh" ---------------------------------- Location: raleighCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create an auto.devel automount map in the raleigh location:
ipa automountmap-add raleigh auto.devel -------------------------------- Added automount map "auto.devel" -------------------------------- Map: auto.devel
$ ipa automountmap-add raleigh auto.devel -------------------------------- Added automount map "auto.devel" -------------------------------- Map: auto.develCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the keys and mount information for the exports/ share:
Add the key and mount information for the auto.devel map:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the key and mount information for the auto.master map:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.4. Configuring automount on an IdM client Copier lienLien copié sur presse-papiers!
As an Identity Management (IdM) system administrator, you can configure automount services on an IdM client so that NFS shares configured for a location to which the client has been added are accessible to an IdM user automatically when the user logs in to the client. The example describes how to configure an IdM client to use automount services that are available in the raleigh location.
Prerequisites
-
You have
rootaccess to the IdM client. - You are logged in as IdM administrator.
- The automount location exists. The example location is raleigh.
Procedure
On the IdM client, enter the
ipa-client-automountcommand and specify the location. Use the-Uoption to run the script unattended:ipa-client-automount --location raleigh -U
# ipa-client-automount --location raleigh -UCopy to Clipboard Copied! Toggle word wrap Toggle overflow Stop the autofs service, clear the SSSD cache, and start the autofs service to load the new configuration settings:
systemctl stop autofs ; sss_cache -E ; systemctl start autofs
# systemctl stop autofs ; sss_cache -E ; systemctl start autofsCopy to Clipboard Copied! Toggle word wrap Toggle overflow