Goglides Dev 🌱

Balkrishna Pandey
Balkrishna Pandey

Posted on

Efficiently Resetting and add new user Htpasswd Secrets in OpenShift

Here is a sequence of commands you can use to reset and add a new user to the OpenShift htpasswd.

oc extract secret/htpasswd-fp844 -n openshift-config --to=- > users.htpasswd

# Reset password in htpasswd
htpasswd -B -b users.htpasswd admin <new-password>

# You can also add new user
htpasswd -B -b users.htpasswd <new-user> <password>

oc create secret generic htpasswd-fp844 -n openshift-config  --from-file=htpasswd=./users.htpasswd --dry-run -o yaml | oc replace -f -
Enter fullscreen mode Exit fullscreen mode

Top comments (0)