Created
November 15, 2024 14:22
-
-
Save rleap-m/33024b6912eaf6dd00ffdac03b5c82eb to your computer and use it in GitHub Desktop.
MKE4 change admin password by changing password hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Courtesy Dmitrii in a Slack channel | |
NAME=admin | |
NEW_PASSWORD=mke4mke4mke4 | |
export HASHED=$(htpasswd -nbBC 10 '' "$NEW_PASSWORD" | tr -d ':\n' | base64) | |
alias km="kubectl -n mke --kubeconfig ~/.mke/mke.kubeconf" | |
km get password $(km get password -o jsonpath="{.items[?(@.email=='$NAME')].metadata.name}") -oyaml | yq '.hash = strenv(HASHED)' | km -n mke apply -f - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment