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 the Certificate-Based CentOS Network (the credentials used to access subscription service or the Customer Portal). When the system is successfully authenticated, it echoes back the newly-assigned consumer ID and the user account name which registered it.
The register options are listed in Table 14.2, "register Options".
Example 14.1. Registering a New Consumer
[root@server1 ~]# subscription-manager register --username admin-example --password secret
7d133d55-876f-4f47-83eb-0ee931cb0a97 admin-example (the new consumer UUID and the account used for registration)In a multi-org environment, it is required that you specify which organization (essentially an independent group or unit within the main account) to join the system to. This is done by using the --org option in addition to the username and password. The given user must also have the access permissions to add systems to that organization. (See "Working with Subscription Asset Manager" for information about organizations and Subscription Asset Manager.)
Example 14.2. Registering a New Consumer with an Organization
If there is more than one organization, then the system must be assigned to one specific organization:
[root@server1 ~]# subscription-manager register --username admin-example --password secret--org="IT Department"7d133d55-876f-4f47-83eb-0ee931cb0a97 admin-example(the new consumer UUID and the account used for registration)
Organizations can be subdivided into environments, which define access to content based on repositories, product versions, and content sets. While a consumer can only belong to a single organization, it can be assigned to multiple environments within that organization. If no environment is given, the subscription service uses the default environment. See "Working with Subscription Asset Manager" for information about organizations and Subscription Asset Manager.
A system can only be added to an environment during registration.
[root@server1 ~]# subscription-manager register --username admin-example --password secret --org="IT Department" --environment=Dev1,ITall
If the system is in a multi-org environment and no organization is given, the register command returns a Remote Server error.
The register command has an option, --autosubscribe, which allows the system to be registered to the subscription service and immediately subscribed to the subscription which best matches its architecture in a single step.
Example 14.3. Automatically Subscribing While Registering
[root@server1 ~]# subscription-manager register --username admin-example --password secret --autosubscribeExample 14.4. Applying Subscriptions During Registration
When using the command-line tools to register the system, there is an option that can pass the activation key to apply existing, already-assigned certificates along with the other registration information. The activation keys are set, in a comma-separated list, in the --activationkey option.
With an activation key, it is not necessary to give a username and password because the authentication is implicit in the activation key.
In hosted or single organization environments, it is not necessary to specify an organization with the --org option, but in multi-org environments, the --org option is required. The organization is not defined as part of the activation key. See "Working with Subscription Asset Manager" for information about activation keys and Subscription Asset Manager.
For example:
# subscription-manager register --activationkey=1234abcd --org="IT Dept"
Table 14.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 |
| --org=name | Gives the organization to which to join the system. | Required, except for hosted environments |
| --environment=name | Registers the consumer to an environment within an organization. | Optional |
| --name=machine_name | Sets the name of the consumer (machine) to register. This defaults to be the same as the hostname. | Optional |
| --autosubscribe | Automatically subscribes this system to the best-matched compatible subscription. This is good for automated setup operations, since the system can be configured in a single step. | Optional |
| --activation_key | Applies existing subscriptions as part of the registration process. The subscriptions are pre-assigned by a vendor or by a systems administrator using Subscription Asset Manager. | Optional |
| --force | Registers the system even if it is already registered. Normally, any register operations will fail if the machine is already registered. | Optional |