An OpenShift cluster can only pull images from registry.redhat.io when its global pull secret, pull-secret in the openshift-config namespace, holds valid Red Hat credentials. The screenshots above show the Customer Portal side: creating a registry service account and copying its token. This page adds the oc commands that merge that token into the cluster pull secret from Linux, macOS or Windows, how to check that the change reached the nodes, and a working version of the test command.
URL – https://access.redhat.com/articles/RegistryAuthentication

Step 1 – Access – https://access.redhat.com/articles/RegistryAuthentication

Step 2 – https://access.redhat.com/terms-based-registry/accounts

Step 3 – https://access.redhat.com/terms-based-registry/token/aro

Step 4 – Local pull-secret at openshift

Step 5 –

Step 6 –

How to test the new registry authentication
oc import-image test-registry-check
--from=registry.redhat.io/openshift4/ose-cli
--confirm -n openshiftCode language: JavaScript (javascript)

Why the global pull secret matters
Every node in an OpenShift 4 cluster pulls images using credentials from the secret pull-secret in the openshift-config namespace. The Machine Config Operator (MCO) copies that secret to each node as /var/lib/kubelet/config.json, and CRI-O uses that file when it pulls images. If the secret has no valid entry for registry.redhat.io, Red Hat images fail with ImagePullBackOff, Red Hat Operator catalogs in OperatorHub stay empty, and image stream imports fail.
This comes up often on clusters created without a Red Hat pull secret, such as Azure Red Hat OpenShift (ARO) clusters built without one, which is likely why the example above uses a token named aro. It also happens when a personal account's credentials are removed or a service account token is regenerated.
Note: Always merge the new credentials into the existing secret. Never replace it. On ARO, the secret also holds entries for Azure's own registries, and the cluster needs them to operate. Overwriting the whole secret can break upgrades and node image pulls.
Prerequisites
- The
ocCLI, logged in as a user withcluster-adminrights (oc whoamiandoc auth can-i update secrets -n openshift-configshould both succeed). - A Red Hat registry service account, created on the Customer Portal's Registry Service Accounts page as shown in steps 1 to 3 above. Its username has the form
1234567|account-name. - The token for that account, from the account's token page in the portal.
- Optionally
jq, to check that the edited JSON is still valid.
Check the credentials on your workstation before you touch the cluster. A typo in the username or token is the most common cause of failure later.
podman login registry.redhat.io --username '1234567|account-name'
# paste the token when prompted
# Expected: Login Succeeded!Code language: PHP (php)
Update the pull secret on Linux or macOS
These commands replace the missing steps 4 to 6 above. They follow the procedure Red Hat documents for updating the global cluster pull secret.
- Export the current pull secret to a local file.
- Add or update the
registry.redhat.ioentry in that file withoc registry login. Entries for other registries stay as they are. - Check the JSON and write the file back to the cluster secret.
# 1. Export the existing secret
oc get secret/pull-secret -n openshift-config \
--template='{{index .data ".dockerconfigjson" | base64decode}}' > pull-secret.json
# 2. Merge the Red Hat registry service account credentials
oc registry login --registry="registry.redhat.io" \
--auth-basic='1234567|account-name:<TOKEN>' \
--to=pull-secret.json
# 3. Validate and apply
jq '.auths | keys' pull-secret.json
oc set data secret/pull-secret -n openshift-config \
--from-file=.dockerconfigjson=pull-secret.json
# 4. Remove the local copy (it contains every registry credential)
rm -f pull-secret.jsonCode language: PHP (php)
The jq output should list registry.redhat.io along with every registry that was there before, such as cloud.openshift.com, quay.io or Azure registry hosts. --auth-basic takes username:password. The service account username contains a pipe character, so keep the whole value in single quotes.
Update the pull secret from Windows PowerShell
Windows PowerShell 5.1, and PowerShell versions before 7.3, can strip the embedded double quotes from the --template argument, which breaks the export. oc extract avoids the problem because it writes the decoded secret straight to a file named .dockerconfigjson.
# Work in a scratch folder
New-Item -ItemType Directory -Force C:\temp\ps | Out-Null
Set-Location C:\temp\ps
# 1. Export the existing secret to .\.dockerconfigjson
oc extract secret/pull-secret -n openshift-config --to=. --confirm
# 2. Merge the Red Hat credentials
oc registry login --registry=registry.redhat.io `
--auth-basic='1234567|account-name:<TOKEN>' `
--to=.dockerconfigjson
# 3. Validate and apply
(Get-Content .\.dockerconfigjson -Raw | ConvertFrom-Json).auths.PSObject.Properties.Name
oc set data secret/pull-secret -n openshift-config --from-file=.dockerconfigjson=.dockerconfigjson
# 4. Clean up
Remove-Item .\.dockerconfigjsonCode language: PHP (php)
In PowerShell the line-continuation character is the backtick (` “), not the backslash. For more on PowerShell syntax, see the PowerShell command line reference.
Note: You can also edit the secret in the web console: switch to the openshift-config project, open Workloads > Secrets > pull-secret, then choose Actions > Edit Secret. Add a new credential entry for registry.redhat.io and leave the existing entries unchanged.
Verify the rollout and test a pull
After the secret changes, the MCO writes the new file to every node. In current OpenShift 4 releases this update does not drain or reboot nodes. Wait until the machine config pools report UPDATED=True and UPDATING=False.
oc get mcp
# NAME CONFIG UPDATED UPDATING DEGRADED ...
# master rendered-... True False False
# worker rendered-... True False False
# Confirm a node received the new credentials (pick any node name)
oc debug node/<node-name> -- chroot /host \
sh -c 'grep -c registry.redhat.io /var/lib/kubelet/config.json'
# Pull directly on the node with CRI-O's credentials
oc debug node/<node-name> -- chroot /host \
podman pull --authfile /var/lib/kubelet/config.json registry.redhat.io/ubi9/ubi:latestCode language: PHP (php)
Use an image stream import to test at the API level. The fixed command from the example above appears in the next section. Running it in a scratch project keeps test objects out of the shared openshift namespace.
Corrected test command
The test command above is split across three lines without continuation characters. A shell runs each line as a separate command, so oc import-image fails with no source, and --from=... and --confirm fail as unknown commands. Here is the corrected version, run in a disposable project:
oc new-project registry-auth-test
oc import-image test-registry-check \
--from=registry.redhat.io/ubi9/ubi:latest \
--confirm -n registry-auth-test
# Success shows image metadata such as the digest and creation date.
oc get istag test-registry-check:latest -n registry-auth-test
# Clean up
oc delete project registry-auth-testCode language: PHP (php)
The ubi9/ubi:latest image always exists, so a failure means the credentials are the problem, not a missing tag. You can still test with openshift4/ose-cli as in the original, but add a tag that exists for your cluster version, for example :v4.16. On Windows, either put the command on one line or end each line with a backtick.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
unauthorized: Please login to the Red Hat Registry using your Customer Portal credentials | No registry.redhat.io entry, or the nodes have not received it yet | Check the entry with oc extract, then wait for oc get mcp to show all pools updated |
invalid username/password | Username is missing the numeric prefix, or the token was regenerated | Copy the username exactly (1234567|name) and the current token from the portal |
| Cluster operators degrade after the change; image pulls from Azure registries fail on ARO | The secret was overwritten instead of merged | Restore the missing entries from a backup or from your platform's documented pull secret, then merge again |
oc set data succeeds but pulls still fail | JSON became invalid during a manual edit | Validate with jq . pull-secret.json before applying |
Machine config pool shows DEGRADED=True | Unrelated MCO problem, or a node that cannot apply config | Run oc describe mcp worker and check the machine-config-daemon pod logs on the affected node |
Security and maintenance practices
- Use a registry service account rather than a personal Customer Portal password. Service accounts can be revoked without locking a person out of their account.
- Create a separate service account for each cluster or environment, so you can revoke one without affecting the others.
- Regenerating a token in the portal invalidates the old one. Update every cluster that uses it right away, or new pulls will start failing.
- Delete local copies of the pull secret after use. The file contains credentials for every registry the cluster uses.
- Back up the current secret before changing it (
oc get secret pull-secret -n openshift-config -o yaml > pull-secret-backup.yaml) and store the backup somewhere secure.
Frequently asked questions
Does updating the OpenShift global pull secret reboot the nodes?
In current OpenShift 4 releases, no. The Machine Config Operator writes the new /var/lib/kubelet/config.json to each node without draining or rebooting it. Use oc get mcp to confirm the rollout has finished.
Can I use my Red Hat Customer Portal username and password instead of a service account?
It works, but it is not recommended. A personal password stored in a cluster secret is hard to rotate and is tied to one person. A registry service account token can be revoked or regenerated on its own.
Why does registry.redhat.io require authentication when registry.access.redhat.com does not?
registry.redhat.io is Red Hat's authenticated registry and requires credentials for every pull. registry.access.redhat.com serves a limited set of content, such as UBI images, without authentication.
How do I add registry.redhat.io credentials to an ARO cluster?
Use the same process: export pull-secret from openshift-config, merge in the registry.redhat.io entry, and apply the file. Keep every existing entry, because ARO depends on its own registry credentials in the same secret.
Can I add the credentials to a single project instead of the whole cluster?
Yes. Create a docker-registry secret in that project with oc create secret docker-registry and link it to the service account with oc secrets link default <secret> --for=pull. Operator catalogs and cluster components still need the global pull secret.
Related tutorials
- More OpenShift tutorials
- Openshift Local: crc command lines guide with example
- Powershell Tutorials: Command Line reference
- OpenShift Lab 11: Build and Deploy an Application from Source Code Using the OpenShift Web Console
- More Windows tutorials
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals