Created
September 23, 2022 16:58
-
-
Save glennswest/7df601bb72039db33e2abda0bd6bda34 to your computer and use it in GitHub Desktop.
Simple bash script to setup htpassd support, and add initial admin users - change to what you want - least secure auth model
This file contains hidden or 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
oc delete secret htpasswd -n openshift-config | |
rm -r -f users | |
mkdir users | |
cd users | |
touch htpasswd | |
htpasswd -Bb htpasswd admin Admin1! | |
htpasswd -Bb htpasswd gwest password | |
oc --user=admin create secret generic htpasswd --from-file=htpasswd -n openshift-config | |
oc replace -f - <<API | |
apiVersion: config.openshift.io/v1 | |
kind: OAuth | |
metadata: | |
name: cluster | |
spec: | |
identityProviders: | |
- name: Local Password | |
mappingMethod: claim | |
type: HTPasswd | |
htpasswd: | |
fileData: | |
name: htpasswd | |
API | |
oc adm groups new mylocaladmins | |
oc adm groups add-users mylocaladmins admin gwest | |
oc adm policy add-cluster-role-to-group cluster-admin mylocaladmins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment