1

In an attempt to run sudo npm install -g aws-amplify/cli , I am given the error The authenticity of host 'github.com (192.30.255.112)' can't be established

After reading The authenticity of host 'github.com (192.30.252.128)' can't be established, I ran ssh -T git@github.com and get a Permission denided (publickey). Error. Now if I run the aws-amplify install again, I get:

npm ERR! code 128
npm ERR! command failed
npm ERR! command git ls-remote ssh://git@github.com/aws-amplify/cli.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/matthewmathias/.npm/_logs/2021-03-20T23_41_46_515Z-debug.log

Help?

M

1 Answers1

0

Start at least by completing your known_hosts:

ssh-keyscan -Ht rsa github.com,192.30.255.112 ~/.ssh/known_hosts

(Although you might want to double-check the fingerprint with nmap first)

Second, try ssh -Tv git@github.com to see what keys are considered.
Make sure to have for instance a ~/.ssh/id_rsa.pub registered to your account.


Warning March 2023:

"GitHub has updated its RSA SSH host key"


Alternatively, force npm to use HTTPS URLs:

 git config --global url."https://github.com/".insteadOf git@github.com:
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250