هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
The quick answer
subscription-manager register --org=1234567 --activationkey=rhel-servers
subscription-manager status
subscription-manager repos --list-enabled
subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms
dnf repolistStep by step
- Create an activation key in the Red Hat Hybrid Cloud Console (Inventory → Activation keys): it holds the settings, so no password is typed on servers. Note your organization ID.
- Register (line 1) — with Simple Content Access (default for most accounts) no extra "attach" step is needed. Interactive alternative:
subscription-manager register --username alice(asks for the password). Newer RHEL also offersrhc connect, which also connects Insights. - Check (lines 2–3) —
statusshowsContent Access Mode is set to Simple Content Access; the enabled list shows BaseOS and AppStream for your version. - Enable extra repositories (line 4) — for example CodeReady Builder (needed by many EPEL packages). List all available:
subscription-manager repos --list | grep 'Repo ID'. - Behind a proxy — set it once:
subscription-manager config --server.proxy_hostname=proxy.example.com --server.proxy_port=3128- Automate — the activation key and org ID in your provisioning (Kickstart, cloud-init, Ansible
community.general.redhat_subscription/rhel_system_roles). Keep them in a secret store. - Before deleting a server — unregister, so it does not keep using a subscription entry:
subscription-manager unregister- Free for labs — the no-cost Red Hat Developer subscription covers up to 16 systems for development and learning.
Check that it worked
subscription-manager status shows Overall Status: Registered (or the SCA message); dnf repolist lists rhel-9-for-x86_64-baseos-rpms, …-appstream-rpms and the enabled CodeReady Builder repo; dnf check-update works.
Common problems
| Problem | Cause | Fix |
|---|---|---|
This system is already registered | Old registration (for example a cloned VM). | subscription-manager unregister / clean, then register again. |
Unable to reach the server | Firewall or proxy. | Allow HTTPS to the Red Hat CDN, or set the proxy. |
Invalid activation key | Wrong key name or org ID. | Copy both from the console; key names are case sensitive. |
dnf repolist empty after register | Repos disabled, or the release is pinned to an old minor version. | repos --list-enabled; subscription-manager release --unset. |
| Clones share one identity | VM template registered before cloning. | Unregister and subscription-manager clean before making a template. |
| Time errors / SSL errors | Wrong system clock. | Sync time with chrony. |
Go further
- Command pages: subscription-manager, rhc, dnf.
- Next how-tos: Patch a server with security updates, Create a local package repository, Set the time zone and sync the clock, Scan a server for compliance with OpenSCAP.
- Learn it: RHCSA — Register RHEL, RHCSA — Register and repositories, RHCSA — Repositories.
1Why use an activation key instead of a user name and password?
The key holds the registration settings, so no personal password is typed on servers or stored in scripts.
2Why unregister a server before deleting it?
Otherwise it stays in your inventory and may still count against your subscriptions.