Oc login

From NovaOrdis Knowledge Base
Jump to navigation Jump to search



'oc login' configures locally a Kubernetes context by updating .kube/config. If it finds no state saved under .kube/config, or no command line options are provided, the command queries the user for OpenShift server, username and password. The command runs in the context of a project. The user must exists on server, and its identity must be correctly resolved by the OpenShift identity provider.


oc login -u <username>:<password>
oc login <api-server-url> -u <username> -p <password>

If -u is not specified, 'oc login' will query for user.

More about OpenShift authentication:

OpenShift Security Concepts | Authentication




Sets the user name.


Sets the password.


Sets the project (namespace) to log into.


oc login --server="https://my-openshift-master:8443" [...]


Specifies the path to the certificate authority file.


Allows interaction with HTTPS server while bypassing server certificate checks.


oc login and Azure OpenShift

OpenShift on Azure | oc login