Questo contenuto non è disponibile nella lingua selezionata.
Chapter 3. Registering a RHEL system with command line tools
With root privileges, you can register your Red Hat Enterprise Linux (RHEL) system from the command line interface (CLI). Registration tools for the CLI include the following clients:
rhc client
Registers a RHEL 8.8 or later system to Red Hat and enables Red Hat Insights with a single command. You can use the
rhc connect
command to connect your system to content repositories through the Red Hat CDN.
Subscription Manager client
Registers a RHEL 8.7 or earlier system, or a Satellite-supported system, to Red Hat. You can use the
subscription-manager register
command to connect your system to content repositories through the Red Hat CDN or through a Satellite Server.
Insights client
Enables Red Hat Insights on a system that has been registered with the Subscription Manager client. If you used the
subscription-manager register
command to register your system, then you can use theinsights-client --register
command to enable Insights.
Each registration command requires authentication options. There are two authentication methods available for the rhc and Subscription Manager clients:
- An activation key and organization ID combination
- A username and password combination
The insights-client --register
command uses the same identity certificate that subscription-manager register
uses; therefore, you do not need to authenticate the insights-client --register
command if you have already used an authentication token to register the system with the subscription-manager register
command.
Activation keys are created and configured by an RHC administrator in your organization. The organization ID is the numeric identifier for your organization and is separate from your account number. Your organization’s activation keys and organization ID are displayed on the Activation Keys page in the Hybrid Cloud Console.
3.1. Registering RHEL 8.8 or later with rhc
You can use the rhc connect
command to register a RHEL 8.8 or later system to Red Hat and enable Red Hat Insights with a single command. Registering a system with the rhc client gives it access to protected content through the Red Hat CDN.
Registering a system to Red Hat requires authentication. There are two authentication methods available:
- An activation key and organization ID combination
- A username and password combination.
Activation keys combine all the system registration steps into one secure, automated process. For example, you can use a preconfigured activation key to automatically register and apply the selected features to a RHEL system with a single command. Additionally, you can put an activation key into a Kickstart file to bulk-provision the registration of multiple RHEL systems. If the file is shared by multiple users, the activation key authenticates the processes without exposing username and password values.
3.1.1. Using an activation key to register RHEL 8.8 or later with rhc
You can use an activation key and a numeric organization identifier (organization ID) with the rhc connect
command to register a system to Red Hat and enable Red Hat Insights with a single command. If an RHC administrator has preconfigured the activation key to apply selected system-level features, such as system purpose attributes, then those features are automatically applied to the system during the registration process.
The activation keys and ID for your organization are displayed on the Activation Key page in the Hybrid Cloud Console.
Prerequisites
- You have a product subscription for RHEL 8.8 or later.
- You are logged in to the Red Hat Hybrid Cloud Console.
- You are logged in as the root user.
- You have the numeric identifier for your organization (organization ID).
Procedure
To use an activation key to register a system with the rhc client, complete the following step:
-
From the terminal, enter the following command, where
<activation_key_name>
is the name of the activation key that you want to use and<organization_ID>
is your organization ID:
# rhc connect --activation-key=<activation_key_name> --organization=<organization_ID>
The expected output confirms that your system is registered. For example:
Connecting kvm-07-guest03.hv2.lab.eng.bos.redhat.com to Red Hat. This might take a few seconds. • Connected to Red Hat Subscription Management • Connected to Red Hat Insights • Activated the Remote Host Configuration daemon Successfully connected to Red Hat! Manage your connected systems: https://red.ht/connector
Verification
To confirm that the system was successfully registered, you can view it in the system Inventory on the Hybrid Cloud Console.
Additional resources
- For information about how to register your system with remote host configuration, see link:https://access.redhat.com/articles/rhc-registration [Registering your host using the remote host configuration client].
- For information about how to create and manage activation keys, see Getting started with activation keys on the Hybrid Cloud Console.
3.1.2. Using a username and password to register RHEL 8.8 or later with the rhc client
If you do not have an activation key, you can use a username and password combination with the rhc connect
command to authenticate the registration process of your RHEL 8.8 or later system.
To avoid exposing username and password values in a shared file, use an activation key and organization ID combination to authenticate the registration process.
Prerequisite
- You have an active product subscription for RHEL 8.8 or later.
- You are logged in to the Red Hat Hybrid Cloud Console.
- You are logged in as the root user.
Procedure
To use a username and password combination to register your RHEL system to Red Hat using the rhc client, complete the following step:
- From the terminal, enter the following command:
# rhc connect --username=<username> --password=<password>
Verification
To confirm that the system was successfully registered, view it in the system Inventory on the Hybrid Cloud Console.
3.1.3. Unregistering RHEL 8.8 or later with rhc
Unregistering a system when you no longer want to use RHEL on that system is recommended as a system hygiene best practice. An unregistered system can no longer receive protected content, software updates, security patches, support, or managed services from Red Hat.
Users with root privileges can use the disconnect
command with the rhc client to remove a system from the subscription management services and Red Hat Insights.
Procedure
To disconnect your system, complete the following step:
- From the terminal, enter the following command:
# rhc disconnect
The expected output is similar to the following example:
Disconnecting <$HOSTNAME> from console.redhat.com. This might take a few seconds. Deactivated the Red Hat connector daemon Manage your Red Hat connector systems: https://red.ht/connector
Next steps
After you unregister a system, the system is deleted from the Red Hat hosted services that manage and report system and subscription data. However, due to different internal processes, the system is deleted from these services at different times. For some of these services, you can manage the timing of the deletion.
- For the subscriptions service, the deletion will occur within approximately 24 hours. The timing is determined by the time of day that the subscriptions service does its data snapshot.
- For the Insights for Red Hat Enterprise Linux inventory service, if you take no action the deletion will occur according to the inventory staleness and deletion policy. However, you can manage the timing of deletion. For immediate deletion, you can delete the system manually from the Systems page. You can also change the settings for automatic deletion by editing the policy for staleness and deletion. For more information, see Viewing and managing system inventory.
Additional resources
- For information about how to unregister your system with the rhc client, see Disconnecting a system using remote host configuration.
3.2. Registering RHEL 8.7 or earlier with Subscription Manager
If you want to register a RHEL 8.7 or earlier system, or access content repositories by using a Satellite Server, then you must use the subscription-manager register
command to connect to Red Hat. Optionally, if you want to enable predictive analytics and remediation capabilities, then you can use the insights-client --register
command to connect the registered system to Red Hat Insights.
Registering a system to Red Hat requires authentication. There are two authentication methods available for the Subscription Manager client:
- An activation key and organization ID combination
- A username and password combination
Activation keys are created and configured by an RHC administrator in your organization. The organization ID is the numeric identifier for your organization and is separate from your account number. The activation keys and ID for your organization are displayed on the Activation Keys page in the Hybrid Cloud Console.
Activation keys combine all the system registration steps into one secure, automated process. For example, you can use a preconfigured activation key to automatically register and apply the selected features to a RHEL system with a single command. Additionally, you can put an activation key into a Kickstart file to bulk-provision the registration of multiple RHEL systems. If the file is shared by multiple users, the activation key authenticates the processes without exposing username and password values.
ADDITIONAL RESOURCES
- For information about the organization ID, see Understanding the Red Hat Subscription Management Organization ID.
- For information about how to create and manage activation keys, see Getting started with activation keys on the Hybrid Cloud Console.
3.2.1. Using an activation key to register RHEL 8.7 or earlier with Subscription Manager
You can use an activation key and a numeric organization identifier (organization ID) with the subscription-manager register
command to register a system to Red Hat. If an RHC administrator has preconfigured the activation key to apply the selected system-level features, such as system purpose attributes, then those features are automatically applied to the system during the registration process.
The activation keys and ID for your organization are displayed on the Activation Keys page in the Hybrid Cloud Console.
Prerequisites
- You have a product subscription for RHEL 8.7 or earlier or you have a Satellite Server.
- You are logged in to the Hybrid Cloud Console.
- You are logged in as the root user.
- You have the numeric identifier for your organization (organization ID).
Procedure
To use an activation key to register a system with Subscription Manager, complete the following steps:
From the terminal, enter the following command, where <activation_key_name> is the name of the activation key that you want to use and <organization_ID> is your organization ID:
# subscription-manager register --activation-key=<activation_key_name> --organization=<organization_ID>
The expected output confirms that your system is registered. For example:
The system has been registered with id: 62edc0f8-855b-4184-b1b8-72a9dc793b96
(Optional) From the terminal, enter the following command to connect the registered system to Red Hat Insights:
yum install insights-client insights-client --register
NoteThe
insights-client --register
command uses the same identity certificate thatsubscription-manager register
uses; therefore, you do not need to authenticate theinsights-client --register
command if you have already used an authentication token to register with thesubscription-manager register
command.
Verification
To confirm that the system was successfully registered, you can view it in the system Inventory on the Hybrid Cloud Console.
Additional resources
- For information about how to create and manage activation keys, see Using activation keys.
3.2.2. Using a username and password to register RHEL 8.7 or earlier with Subscription Manager
If you do not have an activation key, you can use a username and password combination with the subscription-manager register
command to register a system to Red Hat.
To avoid exposing username and password values in a shared file, use an activation key and organization ID combination to authenticate the registration process.
Prerequisite
- You have an active product subscription for RHEL 8.7 or earlier.
- You are logged in to the Hybrid Cloud Console.
- You are logged in as the root user.
Procedure
To use a username and password combination to register your RHEL system to Red Hat with the Subscription Manager client, complete the following steps:
From the terminal, enter the following command:
# subscription-manager register --username=<username> --password=<password>
The expected output is similar to the following example:
The system has been registered with ID: 541084ff2-44cab-4eb1-9fa1-7683431bcf
(Optional) From the terminal, enter the following command to connect the registered system to Red Hat Insights:
yum install insights-client insights-client --register
NoteThe
insights-client --register
command uses the same identity certificate thatsubscription-manager register
uses; therefore, you do not need to authenticate theinsights-client register
command if you have already used an authentication token to register with thesubscription-manager register
command.
Verification
To confirm that the system was successfully registered, you can view it in the system Inventory on the Hybrid Cloud Console.
Additional resources
- For assistance with using a username and password to register RHEL with the Subscription Manager client, see the RHEL registration assistant on the Customer Portal.
- For assistance with registering your RHEL system to Red Hat Insights, see the Insights registration assistant on the Hybrid Cloud Console.
3.2.3. Unregistering 8.7 or earlier with Subscription Manager
Unregistering a system when you no longer want to use RHEL on that system is recommended as a system hygiene best practice. An unregistered system can no longer receive protected content, software updates, security patches, support, or managed services from Red Hat.
Users with root privileges can use the unregister
command with the subscription-manager
client to remove a system from the subscription management services. The command also removes any subscriptions and locally deletes the identity and subscription certificates from the system.
Unregistering a system with the subscription-manager
client terminates your access to the protected content available through the Red Hat CDN or Satellite.
Procedure
To unregister your system, complete the following step:
- From the terminal, enter the following command:
# subscription-manager unregister
The expected output is similar to the following example:
# Unregistering from: subscription.rhsm.redhat.com:443/subscription # System has been unregistered
Next steps
After you unregister a system, the system is deleted from the Red Hat hosted services that manage and report system and subscription data. However, due to different internal processes, the system is deleted from these services at different times. For some of these services, you can manage the timing of the deletion.
- For the subscriptions service, the deletion will occur within approximately 24 hours. The timing is determined by the time of day that the subscriptions service does its data snapshot.
- For the Insights for Red Hat Enterprise Linux inventory service, if you take no action the deletion will occur according to the inventory staleness and deletion policy. However, you can manage the timing of deletion. For immediate deletion, you can delete the system manually from the Systems page. You can also change the settings for automatic deletion by editing the policy for staleness and deletion. For more information, see Viewing and managing system inventory.
3.3. Registering Satellite-supported RHEL with Subscription Manager
If you want to use a Satellite Server, then you must register your system with the Subscription Manager client.
You must register your host system to a Satellite Server before you can synchronize your Satellite content with the Red Hat Content Delivery Network (CDN).