0

I am trying to clone an empty repository from the Google Cloud Resource Repositories. So far I have:

  • Created an empty repository on Google Cloud Source Repositories.
  • Generated an ssh key (default name "id_rsa") from my local machine (Windows 10).
  • Registered the contents of the public key (id_rsa.pub) in the Register SSH Key section of Cloud Source Repositories.
  • Opened Git Bash and run git clone ssh://blah@gmail.com@source.developers.google.com:2022/p/some-project/r/some-repository

However, it fails with this response:

Cloning into 'some-repository'...
Enter passphrase for key '/c/Users/blah/.ssh/id_rsa':
fatal: could not fetch refs from ssh://blah@gmail.com@source.developers.google.com:2022/p/some-project/r/some-repository

I am running Git Bash from Windows 10

It does label SSH Authentication as BETA on Cloud Resource Repositories, which makes me wonder if it might not be fully functional yet.
Has anyone managed to connect to Cloud Resource Repositories via SSH?

Any help or advice much appreciated. Thank you

Glenster
  • 1,187
  • 2
  • 13
  • 31

2 Answers2

3

Try first to use an SSH key without passphrase, and make sure to create it with the legacy format:

ssh-keygen -m PEM -t rsa -P ""

(The -m PEM is for producing the legacy format)

That will overwrite your previous key: register the new id_rsa.pub content, and try again.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for the suggestion. I already tried without a passphrase but it didn't work either. For now I have resorted to using "Google Cloud SDK" – Glenster Apr 30 '19 at 05:03
  • @GlenAu-Yeung did you try with the -m PEM: that is the important part, to generate a key to the legacy format. – VonC Apr 30 '19 at 05:03
  • Thank you so much- It worked. In the end I created a key with a passphrase but using the -m option as you suggested. However, I couldn't find anything on the -m option in the man page or documentation for ssh-keygen. Would you mind directing me to where I can find more information on this option? – Glenster May 02 '19 at 09:04
0

Type ssh-keygen and press ENTER. A passphrase is optional.

Note: if the ssh-keygen is not recognized you need to install OpenSSH.

Ronnie Royston
  • 16,778
  • 6
  • 77
  • 91