How To Reset Rancher Console Password For Admin User?

Rancher console cannot be accessed as the password from secret rancher-admin-password does not work.

How to reset Rancher console admin password:

  1. Find Rancher-server pod:

kubectl get pod -A | grep rancher-server

  1. Run reset password inside the rancher pod, please use the POD_NAME from step1:

kubectl exec -n cattle-system rancher-server-PodName -- reset-password

  1. Login with admin user and password obtained at step2.

  1. According to documentation the pass is stored in a secret, encrypted base64. As secret is not updated, encrypt the password and edit the secret.

echo "PassFromStep2" | base64
kubectl edit secret rancher-admin-password -n cattle-system

  1. Now password can be retrieved with command from docs:

kubectl get secrets/rancher-admin-password -n cattle-system \

-o "jsonpath={.data['password']}" | echo $(base64 -d)