简体   繁体   English

Heroku部署应用程序并添加SSH密钥

[英]Heroku deploying app and adding SSH key

Trying to push code to the Heroku server using this command 尝试使用此命令将代码推送到Heroku服务器

$ heroku login
Enter your Heroku credentials.
Email: jaskobh@hotmail.com
Password (typing will be hidden):
Your Heroku account does not have a public ssh key uploaded.
Could not find an existing public key at ~/.ssh/id_rsa.pub
Would you like to generate one? [Yn] Y
Generating new SSH public key.
Uploading SSH public key C:/Users/USERNAME/.ssh/id_rsa.pub... done
Authentication successful.


$ git push heroku master

but receive error 但收到错误

The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad
Connection abandoned.
fatal: Could not read from remote repository.

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

So key is uploaded and it exist but it wont let me push the code. 因此,密钥已上传并且存在,但是它不会让我推送代码。
Any ideas ? 有任何想法吗 ?

SSH asks you to confirm the key of a server the first time you connect to it, but git gives you an error straight away. SSH要求您在首次连接时确认服务器的密钥,但是git会立即给您错误。 But SSH will remember that server after your first attempted connection, even if it wasn't successful . 但是SSH会在您首次尝试连接后记住该服务器, 即使该服务器不成功也是如此

Run this command on the commandline: 在命令行上运行以下命令:

ssh heroku.com

And you'll see a prompt like this: 然后您会看到如下提示:

The authenticity of host 'heroku.com (50.19.85.132)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
Are you sure you want to continue connecting (yes/no)?

Type "yes". 输入“是”。 You won't connect to the remote machine - Heroku doesn't allow remote logins - but ssh will remember that host key, and you'll be able to git push . 您将无法连接到远程计算机-Heroku不允许远程登录-但ssh会记住该主机密钥,并且您可以git push

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM