الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

rhc

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

المستوى
لينكس اليومي
المجموعة
حزم البرامج
يحتاج root
نعم
الحزمة
rhc

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

ماذا يفعل

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.

طريقة الكتابة

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

الأجزاء الرئيسية

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.

الخيارات 9

الأكثر استخدامًا

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.

أمثلة 10

$ مستخدم عادي# بصلاحية root (أو مع 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

انتبه

  • 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.

الملفات

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

نصائح للحفظ

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

رموز الخروج

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