Changing the Cloud Pak administrator access credentials
You can update the administrator username and password.
cpadmin is the default admin
user name.Before you begin
-
Install the OpenShift client.
-
Ensure that you must have
administratoraccess to update the administrator username and password.
Supported languages
You can change the default administrator username
cpadmin to a custom username. The username can be in
the following languages:
| Language | Language code |
|---|---|
| Brazilian Portuguese | pt_br |
| English | en |
| French | fr |
| German | de |
| Italian | it |
| Japanese | ja |
| Korean | ko |
| Chinese Simplified | zh_CN |
| Chinese Traditional | zh_TW |
| Spanish | es |
Changing the administrator username
Complete the following steps to rename a default admin user in Platform UI:
-
Review the current admin and password.
oc -n <your-foundational-services-namespace> get secret platform-auth-idp-credentials -o yaml | grep admin |xargs -l bash -c 'echo -n "$0 " ; echo "$1" | base64 -d && echo'The sample output:
admin_password: IRXkjnsZg8nUUK8S2BBVFJeIOW0wVrhD admin_username: cpadmin -
Get the access token. For more information, see Preparing to run API commands.
-
Run the following CURL command to update default admin username:
curl -X PUT 'https://cp-console.apps.mycluster.mydomain.fyre.ibm.com/idmgmt/identity/api/v1/users/defaultAdmin' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header "Authorization: Bearer $ACCESS_TOKEN" \ -d "{\"username\": \"${new_admin_username}\"}" \ --insecure -
Restart the
platform-identity-providerandplatform-auth-servicepods by deleting them.-
Get the
platform-identity-providerpod name andplatform-auth-servicepod name .oc get pods -n <your-foundational-services-namespace> | grep platform-identity-provideroc get pods -n <your-foundational-services-namespace> | grep platform-auth-service -
Delete the
platform-identity-providerpod andplatform-auth-servicepod.oc delete pod <platform-identity-management-pod-name> -n <your-foundational-services-namespace>oc delete pod <platform-auth-service-pod-name> -n <your-foundational-services-namespace>
-
-
After the pods restart, login to
cp-consoleto test whether the default username has changed.oc get routes -n <your-foundational-services-namespace> |grep -i cp-console
Changing the administrator password
The administrator password is stored in a Kubernetes Secret.
Complete the following steps to change the administrator password in Platform UI:
-
Review the current admin and password.
oc -n <your-foundational-services-namespace> get secret platform-auth-idp-credentials -o yaml | grep admin |xargs -l bash -c 'echo -n "$0 " ; echo "$1" | base64 -d && echo'The sample output:
admin_password: IRXkjnsZg8nUUK8S2BBVFJeIOW0wVrhD admin_username: admin -
Update the
admin_passwordfield in theplatform-auth-idp-credentialssecret with the new password.-
In the namespace where foundational services is installed, edit the
platform-auth-idp-credentialssecret:oc edit secret platform-auth-idp-credentials -n "${SERVICES_NAMESPACE}"
Where, {SERVICES_NAMESPACE} is the namespace name where foundational services is installed.
- Search for
admin_passwordvalue inplatform-auth-idp-credentialssecret and replace it with the new password. The new password must bebase64-encodedpassword.
-
-
Restart the
platform-auth-service,platform-identity-provider,platform-identity-management, andusermgmtpods by deleting them.-
Delete the
platform-auth-servicepod.-
Get the
platform-auth-servicepod name.oc get pods -n <your-foundational-services-namespace> | grep platform-auth-service -
Delete the
platform-auth-servicepod.oc delete pod <platform-auth-service-pod-name> -n <your-foundational-services-namespace>
-
-
Delete the
platform-identity-providerpod.-
Get the
platform-identity-providerpod name.oc get pods -n <your-foundational-services-namespace> | grep platform-identity-provider -
Delete the
platform-identity-providerpod.oc delete pod <platform-identity-provider-pod-name> -n <your-foundational-services-namespace>
-
-
Delete the
platform-identity-managementpod.-
Get the
platform-identity-managementpod name.oc get pods -n <your-foundational-services-namespace> | grep platform-identity-management -
Delete the
platform-identity-managementpod.oc delete pod <platform-identity-management-pod-name> -n <your-foundational-services-namespace>
-
-
Delete the
usermgmtpod.-
Get the
usermgmtpod name.oc get pods -n <your-foundational-services-namespace> | grep usermgmt-<pod-name> -
Delete the
usermgmtpod.oc delete pod <usermgmt-pod-name> -n <your-foundational-services-namespace>
-
-
After the pod restart, login to cp-console to test
whether the password has changed.
oc get routes -n <your-foundational-services-namespace> |grep -i cp-console
The password must follow the defined password rules.
Password rules
Password rules are optional, regular expressions (regex) that
are used to set and validate managed password values within a
namespace. The update-secret command checks password
rules before changing the values in the secret. It validates if
rules exist on the namespace that the secret is in, and that the
secret data element name change contains pass or
pwd in any case combination.
| Rule | Regex |
|---|---|
| Min length 10 |
^.{10,}
|
| Max length 10 |
^.{0,10}$
|
| Length range |
^.{10,20}$
|
| Require lower |
.*[a-z].*
|
| Require upper |
.*[A-Z].*
|
| Require num |
.*[0-9].*
|
| Require spec |
.*[!@#$%^&*].*
|