0

I am trying to open a port via ssh in my VM instance in Google Compute engine but I keep getting error messages.

Here is my command:

myname@instance-2:~$ gcloud compute firewall-rules create baasbox-console-port --allow tcp:9000 --source-range
s=0.0.0.0/0

here is the error message:

NAME NETWORK SRC_RANGES RULES SRC_TAGS TARGET_TAGS
ERROR: (gcloud.compute.firewall-rules.create) Some requests did not succeed:
 - Insufficient Permission

pls what am i doing wrong?

2 Answers 2

2

gcloud auth login Go to the following link in your browser: (Cut and past the link into your browser address bar) For me (Ubuntu 14.04) this does not return a verification code on FireFox, use Chromium. You should get a long string of characters as a verification code. Cut and past this into the terminal. I would then see this:

ERROR: There was a problem with web authentication.ERROR: (gcloud.auth.login) invalid_grant

After several tries of generating the code and pasting it, I copied the code and the trailing colon(:) then it worked

1

You need to do either of the following:

  1. run gcloud auth login in your instance, or

  2. when you create your VM, you need to give it read-write access to Google Cloud Platform APIs by adding the compute-rw scope as follows:

    gcloud compute instances create $VM --scopes compute-rw [...]
    

    See the gcloud compute instances create docs for more info.

Not the answer you're looking for? Browse other questions tagged or ask your own question.