Getting "http error 401-unauthorized:invalid username or password error" while trying to register system

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux
  • Red Hat Subscription Management (RHSM)

Issue

  • While registering the client machine to the customer portal using the subscription-manager register command, it fails with the below error:

    # subscription-manager register --username "xxxxxx"--password  "xxxxxxxx" 
    Registering to: subscription.rhsm.redhat.com:443/subscription
    HTTP error (401 - Unauthorized): Invalid username or password. To create a login, please visit 
    https://www.redhat.com/wapps/ugc/register.html
    

    or,

    # subscription-manager register
    Registering to: subscription.rhsm.redhat.com:443/subscription
    Username:*******
    Password:
    HTTP error (401 - Unauthorized): Invalid user credentials
    
  • Getting invalid username or password while trying to register the system with RHSM.

Resolution

  1. To successfully register the system with subscription-manager (RHSM), ensure the password does not contain spaces or special characters. If the password includes any, reset it here with a password that does not contain any spaces or special characters.

  2. Clear the subscription-manager data and re-register the system using the following commands:

    # subscription-manager clean
    # subscription-manager register
    # subscription-manager attach --auto 
    

    After registering check if yum working:

    # yum clean all 
    # yum repolist
    
  3. Ensure Login ID/User ID is used instead of Email Address to register RHEL machine.

Root Cause

  • Subscription-manager (RHSM) does not honor the value when a blank space or special character is added to a password.

Diagnostic Steps

  • Verify if the password contains blank space or special character.

  • Check if Email Address is used to register system instead of Login ID.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments