Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » AWS/Azure/OpenShift » OpenShift common Commands
  • How to manage user permission in AD and Synology
    Manage User Permission on Synology with Active Directory [Part 1] Reviews
  • Container insights
    How to use Container Insights for Azure Kubernetes Workload Network | Monitoring
  • dropbox
    Couldn’t start Dropbox: How to fix and reinstall Dropbox Mac
  • Fix 0x800f0831 Windows Update
    Fix 0x800f0831 Error when installing Windows update Windows
  • mssql
    Fix MSSQL Connection timeout and timeout period expired Oracle/MSSQL/MySQL
  • How to Install SonarQube on Ubuntu LTS
    How to Install SonarQube on Ubuntu 20.04 LTS Network | Monitoring
  • Review of Stellar Repair for Outlook
    A Review of Stellar Repair for Outlook Reviews
  • Continuous Deployment Pipeline Using AWS CodePipeline
    Setup a Continuous Deployment Pipeline with AWS CodePipeline AWS/Azure/OpenShift

OpenShift common Commands

Posted on 05/01/202023/09/2023 Christian By Christian No Comments on OpenShift common Commands
OpenShift

You can find a summary of the key commands covered below, along with some related commands. To see more information on each oc command, run it with the –help option.

oc login: Log in to your OpenShift cluster and save the session token for subsequent use. You will be prompted for the user name and password or directed to a web console page where you can obtain a token you must then use to use to login from the command line. The web page will require you to first login in to the web console if you are not already logged in.
oc login: Log in to a specific OpenShift cluster. You will need to specify the name of the server as argument the first time you are using it, or if switching back to it after having used a different cluster.
oc login –username: Log in to your OpenShift cluster as a specific user.
oc login –username –password: Log in to your OpenShift cluster as a specific user and supply the password on the command line. Note that this is not recommended for real systems as your password may be logged or retained in command history.
oc login –token: Log in to your server using a token for an existing session.
oc logout: Log out of the active session by clearing the session token.
oc whoami: Show the name of the user for the current login session.
oc whoami –token:Show the token for the current login session.
oc whoami –show-server:Show which OpenShift cluster you are logged into.
oc whoami –show-context: Shows the context for the current session. This will include details about the project, server and name of user, in that order.
oc config get-clusters:Show a list of all OpenShift clusters ever logged in to.
oc config get-contexts:Show a list of contexts for all sessions ever created. For each context listed, this will include details about the project, server and name of user, in that order.
oc adm policy add-role-to-user edit -n:Add another user to a project so that they can work within the project, including creating new deployments or deleting applications.
oc adm policy add-role-to-user view -n: Add another user to a project but such that they can only view what is in the project.
oc adm policy add-role-to-user admin -n: Add another user to a project such that they are effectively a joint owner of the project and have administration rights over it, including the ability to delete the project.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
AWS/Azure/OpenShift

Post navigation

Previous Post: Retrieve an SSL Thumbprint in Windows using PowerShell
Next Post: How to create a Microsoft HyperV checkpoint

Related Posts

  • a Multiple SPF Records  Issues and Examples@2x
    How to setup SPF and TXT Records in AWS AWS/Azure/OpenShift
  • CreateanAWSact
    How to Set up an Amazon Web Services (AWS) Account AWS/Azure/OpenShift
  • azure logo 1
    How to use the built-in Azure Active Directory Connect tool AWS/Azure/OpenShift
  • redirects3endpoint
    How to redirect requests for your bucket’s website endpoint to another bucket or domain AWS/Azure/OpenShift
  • S3 Bucket 1
    How to delete AWS S3 Bucket and Objects via  AWS CLI from Linux AWS/Azure/OpenShift
  • s3
    How to Copy from a server to s3 and vice versa AWS/Azure/OpenShift

More Related Articles

a Multiple SPF Records  Issues and Examples@2x How to setup SPF and TXT Records in AWS AWS/Azure/OpenShift
CreateanAWSact How to Set up an Amazon Web Services (AWS) Account AWS/Azure/OpenShift
azure logo 1 How to use the built-in Azure Active Directory Connect tool AWS/Azure/OpenShift
redirects3endpoint How to redirect requests for your bucket’s website endpoint to another bucket or domain AWS/Azure/OpenShift
S3 Bucket 1 How to delete AWS S3 Bucket and Objects via  AWS CLI from Linux AWS/Azure/OpenShift
s3 How to Copy from a server to s3 and vice versa AWS/Azure/OpenShift

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a
 
  • How to manage user permission in AD and Synology
    Manage User Permission on Synology with Active Directory [Part 1] Reviews
  • Container insights
    How to use Container Insights for Azure Kubernetes Workload Network | Monitoring
  • dropbox
    Couldn’t start Dropbox: How to fix and reinstall Dropbox Mac
  • Fix 0x800f0831 Windows Update
    Fix 0x800f0831 Error when installing Windows update Windows
  • mssql
    Fix MSSQL Connection timeout and timeout period expired Oracle/MSSQL/MySQL
  • How to Install SonarQube on Ubuntu LTS
    How to Install SonarQube on Ubuntu 20.04 LTS Network | Monitoring
  • Review of Stellar Repair for Outlook
    A Review of Stellar Repair for Outlook Reviews
  • Continuous Deployment Pipeline Using AWS CodePipeline
    Setup a Continuous Deployment Pipeline with AWS CodePipeline AWS/Azure/OpenShift

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,841 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.