I am unable to add a user on the local htpasswd file using the htpasswd command. It looks like this file is locked by a process, but I am unable to determine how I can unlock (ran a lsof command to search for htpasswd).
$ htpasswd /usr/bin/htpasswd garima htpasswd: cannot open file /usr/bin/htpasswd for read/write access $ htpasswd -c /usr/bin/htpasswd garima htpasswd: cannot open file /usr/bin/htpasswd for read/write access
The htpasswd commands shall run as root. Also, /usr/bin/htpasswd is wrong. You are trying to write passwords to the binary and it should be /etc/openshift/openshift-passwd.
# htpasswd -c /etc/openshift/openshift-passwd garima
To add another user
# htpasswd /etc/openshift/openshift-passwd neha
Also make sure you had made changes in your /etc/openshift/master/master-config.yaml.
identityProviders: - name: my_htpasswd_provider challenge: true login: true provider: apiVersion: v1 kind: HTPasswdPasswordIdentityProvider file: /etc/openshift/openshift-passwd
Restart your master once you have edited the config:
# systemctl restart openshift-master