Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

rhc

Connect a RHEL system to Red Hat: registration (content), Red Hat Lightspeed analytics and remote management — in one command.

Niveau
Dagelijks Linux
Groep
Softwarepakketten
Root nodig
Ja
Pakket
rhc

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

rhc (Remote Host Configuration) is the simple registration client of RHEL. rhc connect registers the system with Red Hat Subscription Management (so dnf gets the BaseOS and AppStream repositories), turns on Red Hat Lightspeed (the service that was called Red Hat Insights) and connects the system to the Hybrid Cloud Console at console.redhat.com for remote tasks. Each part can be turned off with --disable-feature.

Use an activation key and the organization ID for scripts and many systems; a user name and password for a single test machine.

Zo schrijf je het

rhc connect [OPTION]...
rhc disconnect
rhc status

Belangrijkste delen

Commands

connect
Register the system and turn on the features.
disconnect
Unregister and turn the features off.
status
Show what is connected.
help
Show help.

Opties 9

Meest gebruikt

connect

-u, --username=USER
Red Hat account user name.
-p, --password=PASS
Password (asked if not given).
-o, --organization=ID
Organization ID (with an activation key).
-a, --activation-key=KEY
Activation key name; can be given more than once.
--content-template=NAME
Use a content template from the console.
--disable-feature=FEATURE
Turn off content, analytics or remote-management.
--enable-feature=FEATURE
Turn on a feature.

Global

--format=json
JSON output (for scripts).
-h, --help / -v, --version
Help / version.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1Register a test machine with your account

    rhc connect --username anna.admin
    Password:
    ...
    Successfully connected to Red Hat!
  2. 2Register with an activation key (scripts, many servers)

    rhc connect --organization 12345678 --activation-key web-servers
  3. 3Register without remote management

    rhc connect -o 12345678 -a web-servers --disable-feature remote-management
  4. 4Only content, no analytics

    rhc connect -o 12345678 -a base --disable-feature analytics --disable-feature remote-management
  5. 5Check the state

    rhc status
    subscription-manager status
    dnf repolist
  6. 6JSON output for automation

    rhc status --format json
  7. 7Unregister before you delete or clone a VM

    rhc disconnect
  8. 8Get remote fixes from the console (Ansible playbooks)

    dnf install -y rhc-worker-playbook
    systemctl restart rhcd
  9. 9Register in a Kickstart %post (one way)

    cat ks-snippet.txt
    %post
    rhc connect --organization 12345678 --activation-key web-servers
    %end
  10. 10See the service that keeps the console connection

    systemctl status rhcd

Let op

  • The organization ID and activation key can register systems to your account. Keep them out of public repositories.
  • rhc is only for systems that connect directly to Red Hat. With Red Hat Satellite, use subscription-manager.

Bestanden

/etc/rhc/config.toml
Settings of rhc.
/var/log/rhsm/rhsm.log
Log of the registration part.

Tips om te onthouden

  • Kickstart also has its own rhsm --organization=ID --activation-key=KEY command for registration during the installation.

Exitcodes

0Success.
Not 0Error (wrong key, no network, already connected).