2

Getting this error message

So I am trying to run a terraform init from my local machine against code hosted in azure devops

I am getting this prompt and not sure how to proceed. I’ve tried y, yes, leaving it blank but it errors out and doesn’t download the modules

I recreated the ssh keys on my local machine and performed:

Ssh-key scan -H -t rsa.ssh.dev.azure.com > $env:userprofile/.ssh/known_hosts

Ssh-key scan -H -t vs-visualstudio.com > $env:userprofile/.ssh/known_hosts

Still getting the prompt and still getting a

Could not download module “**********” source code from git@vs-ssh.visualstudiocode.com/v3/<organization_name>/<project>/<repo>
…
Public key authentication failed
Fatal: could not read from remote repository
Please make sure you have the correct access rights and the repository exists

Tried in visual studio and Git bash terminal.

Any idea on what I am supposed to enter in that box and how to proceed?

Vetements
  • 69
  • 7
  • 1
    `Ssh-keys can` does not seem right, did you mean `ssh-keyscan`? If you did use `Ssh-keys can`, this probably did not work, which would leave you with the same problem. However, the `public key authentication failed` message suggests that you've moved on to a different problem, which is that you don't have the right keys set up. – torek Sep 16 '22 at 02:49
  • @torek Typo in the post, just amended. Would the issue be that I need specifically configure ssh keys within visual studio code? – Vetements Sep 16 '22 at 02:54
  • I don't know if VS has any special ssh items. Git itself just *runs* ssh, which is why Git-for-Windows comes with an ssh implementation: some Windows systems don't have any ssh to run. This in turn leads to Windows problems where you configure ssh on Windows (configuring ssh installation #1) and then you run `git clone` with an ssh URL and Git runs ... ssh installation #2, which uses completely different configuration files, and hence isn't configured, even though you configured ssh. – torek Sep 16 '22 at 02:59
  • The usual solution to *that* problem is to remove the extra ssh and/or make sure Git uses the system-provided ssh, as long as the system-provided ssh actually works with Git. That way you don't have two separate ssh subsystems with separate configurations. – torek Sep 16 '22 at 02:59

1 Answers1

0

Still getting the prompt and still getting a

Regarding the Public key authentication failed, check "Git SSH public key authentication failed with git on Azure DevOps"

You would still need to define a %USERPROFILE%\.ssh\config file in order to reference the right private key for git@ssh.dev.azure.com and git@vs-ssh.visualstudio.com

Try also (as noted in the documentation):

ssh-keyscan -t rsa ssh.dev.azure.com >> $env:userprofile/.ssh/known_hosts
ssh-keyscan -t rsa vs-ssh.visualstudio.com >> $env:userprofile/.ssh/known_hosts

That differs from the Ssh-key scan -H -t vs-visualstudio.com from your question.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250