OpenShift - Remote shell to a pod using the oc rsh command

by
Jeremy Canfield |
Updated: October 19 2021
| OpenShift articles
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
A node contains one or more pods, and each pod contains one or more containers.
Before issuing the oc rsh command, issue the oc login command and you may want to also use the oc get pods command to list the pods in a project. In this example, a remote shell is made to pod001 in project001.
oc rsh -n project001 pod001
If you successfully connect to the pod, something like this should be displayed. You can now run commands on the pod.
Defaulting container name to elasticsearch.
Use 'oc describe pod/pod001 -n project001' to see all of the containers in this pod.
sh-4.2$
Did you find this article helpful?
If so, consider buying me a coffee over at