Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

-bash: ping: command not found

In the lesson they ping their vm but ping isnt a valid command

Marko Livancic

How exactly are you trying to ping the VM?

Shoaibahmed Shaikh

In this session the instructor is using ping cmd to how we can access the VMs thru external IP only and not by VM name or ts internal IP address

Shoaibahmed Shaikh

But when I try to ping the VM which i created and ping to its external IP address just as the instructor i am getting error "-bash: ping: command not found"

Shoaibahmed Shaikh

Can someone explain why i am getting this error even when i followed evry steps with the instructor

David Spenard

You can install ping on the cloud shell instance with: "sudo apt update" and then "sudo apt install iputils-ping"

Shoaibahmed Shaikh

thanks david i was able to install it

newbie_22

Hey David. I have one more doubt. Once we do the sudo update and install ping. Is this change persistant across sessions. Like if i log off and log in next time, will this change still be valid ?

2 Answers

Ping requires root access which the default user on cloud shell does not have. Hence the command is disallowed.

Once ping was installed into the GCP Cloud Shell non-ephemeral version, I was able to PING the IP address of ‘myhappyvm’ but not the "NAME" as listed in the video.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?