Show Table of Contents
2.2. Registering from the Command Line
The simplest way to register a machine is to pass the
register command with the user account information required to authenticate to Customer Portal Subscription Management. When the system is successfully authenticated, it echoes back the newly-assigned system inventory ID and the user account name which registered it.
The
register options are listed in Table 2.2, “register Options”.
Note
To use an on-premise subscription management app`lication, first configure the client, and then run the
register command.
Example 2.1. Registering a System to the Customer Portal
[root@server1 ~]# subscription-manager register --username admin-example --password secret The system has been registered with id: 7d133d55-876f-4f47-83eb-0ee931cb0a97
Example 2.2. Automatically Attaching While Registering
The
register command has an option, --auto-attach, which allows the system to be registered to the subscription service and immediately attaches the subscription which best matches the system's architecture, in a single step.
[root@server1 ~]# subscription-manager register --username admin-example --password secret --auto-attach
This is the same behavior as when registering with the default settings in the Subscription Manager UI.
Table 2.2. register Options
| Options | Description | Required |
|---|---|---|
| --username=name | Gives the content server user account name. | Required |
| --password=password | Gives the password for the user account. | Required |
| --serverurl=hostname | Gives the hostname of the subscription service to use. If this option is not used, the system is registered with Customer Portal Subscription Management. | Required for Red Hat Subscription Asset Manager |
| --baseurl=URL | Gives the hostname of the content delivery server to use to receive updates. Both Customer Portal Subscription Management and SAM use Red Hat's hosted content delivery services, with the URL https://cdn.redhat.com. Since Red Hat Satellite hosts its own content, the URL must be used for systems registered with Red Hat Satellite. | Required for Red Hat Satellite |
| --org=name | Gives the organization to which to join the system. | Required, except for hosted environments |
| --environment=name | Registers the system to an environment within an organization. | OptionalGUI |
| --name=machine_name | Sets the name of the system to register. This defaults to be the same as the hostname. | Optional |
| --auto-attach | Automatically attaches the best-matched compatible subscription. This is good for automated setup operations, since the system can be configured in a single step. | GUI Optional |
| --activationkey=key | Attaches existing subscriptions as part of the registration process. The subscriptions are pre-assigned by a vendor or by a systems administrator using SAM. | Optional |
| --servicelevel=None|Standard|Premium | Sets the service level to use for subscriptions on that machine. This is only used with the --auto-attach option. | Optional |
| --release=NUMBER | Sets the operating system minor release to use for subscriptions for the system. Products and updates are limited to that specific minor release version. This is used only used with the --auto-attach option. | Optional |
| --force | Registers the system even if it is already registered. Normally, any register operations will fail if the machine is already registered. | Optional |
| --type=TYPE | Sets what type of consumer is being registered. The default is system, which is applicable to both physical systems and virtual guests. Other types include hypervisor for virtual hosts, person, domain, rhui, and candlepin for some subscription management applications. | Optional |

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.