0

I am trying to run gitlab on Google Cloud Platform. I followed this tutorial: https://docs.gitlab.com/ce/install/google_cloud_platform/index.html but now I am at the point when I cannot push the commit to the remote.

git@33.22.33.22: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The SSH key is added to the Google Cloud Platform VM as well as Gitlab account. I believe I have to enable git over ssh somehow but not really sure how these things go with Google Cloud Platform's security.

Jan Richter
  • 183
  • 1
  • 11
  • have you tried SSH-ing into the machine using gcloud so that it can add the instance to your list of known hosts? `gcloud compute --project "project-name" ssh --zone "europe-west2-c" "instance-name"` – Jan Vladimir Mostert Mar 18 '18 at 09:22
  • Added my key manually in VM management and SSH under my username worked. The command you mentioned worked too, I think there has to be some way to add `git` user too. Not really sure how this works though. – Jan Richter Mar 18 '18 at 09:36

1 Answers1

2

So the problem was somewhere else.

I recently changed the IP address of the VM (to have a static one). Unfortunately, I forgot to change the IP in GitLab settings so the clone links are still pointing to the old one. Hence the Could not read from remote repository.

Jan Richter
  • 183
  • 1
  • 11