Code 401: Expired JWT Token in CloudLinux: How to Fix It
The Code 401: Expired JWT Token error in CloudLinux is a regular problem in the world of server management. This error can stop your server from running smoothly, making it impossible to collect and send important data to the centralised Monitoring system. We’ve put together a complete guide to analyzing and fixing the Code 401 error to help you fix this problem and get things back to normal.
Understanding the Error
When the CloudLinux JWT code runs out of time or is lost, you may get a message or see the following error message:
Check existing JWT token:
FAILED: The JWT code has run out. Please check “/etc/sysconfig/rhn/jwt.token” for a JWT token.
If you don’t have a code, you can try running “rhn_check” to get one.
Without a correct JWT token, the server can’t gather data and send them to Centralised Monitoring.
If you need more help, go to FAQ and Troubleshootingfor more
information. If you can’t figure out what’s wrong, please call CloudLinux Support at
CloudLinux Support.
Troubleshooting Steps
Follow these step-by-step steps to fix the Code 401 error and get your CloudLinux server to work again:
Step 1: Moving or Removing the JWT Token
The first step is to either move or get rid of the JWT code that is already there. Using the following program, you can do this:
mv -v /etc/sysconfig/rhn/jwt.token{,.bak}
Step 2: Registering CloudLinux
After taking care of the current token, it is very important to make sure CloudLinux is registered correctly. Run the following code to make this happen:
The command is: clnreg_ks --force
Step 3: Generating a new token
Now that CloudLinux is registered, a new JWT code needs to be made. Use the following code to start the process of making tokens:
rhn_check
Step 4: Verifying the Token
Once the process of making a token is done, it is important to check that the token was made correctly. This can be done by typing in the following command:
cat /etc/sysconfig/rhn/jwt.token
Conclusion
Codeyo Genie is here to help, so don’t forget that. If you need more help or would rather have an expert show you the way, Contact us today to improve how your website works and make sure your users can always get to it.