How to get ssh access from master node to node01

Vishal Hedaoo:
How to get ssh access from master node to node01.

SHANKAR NAG MACHIRAJU:
Student question: ssh node01

Vishal Hedaoo:
Thanks for quick reply… I was using kubectl exec -it command

Akhil Jahagirdar:
in a real world scenario, it would be like , kubectl get nodes -o wide, get the ip of the node and ssh user@ip-of-the-node

Vishal Hedaoo:
Thanks Akhil…Any idea what is the use of kubectl exec -it cmd and when we use this…Might be i am confused in docker exec and kubectl exec cmd

Nagesh Jayaram:
Hi Vishal,
this is same purpose as docker exec, But now you need kubectl exec pod ,

One of simple example would be to run nslookup from busybox pod/container after getting a shell to busybox

so you can run
kubectl exec -it busybox sh (This will give the shell prompt in the busybox container)

Hi,

Just wondering, in the lab, how do I know what’s username/password to ssh node01?

Thanks,
Chance

Hello, @Chance
We don’t need to worry for username/password for any node. It’s already pre-configured with passwordless.

1 Like