Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Heroku部署应用程序并添加SSH密钥_Node.js_Heroku - Fatal编程技术网

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

Node.js Heroku部署应用程序并添加SSH密钥,node.js,heroku,Node.js,Heroku,尝试使用此命令将代码推送到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

尝试使用此命令将代码推送到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
但是接收错误

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.
所以密钥是上传的,它存在,但它不会让我推代码。
有什么想法吗?

SSH要求您在第一次连接到服务器时确认服务器的密钥,但git会立即给您一个错误。但SSH会在您第一次尝试连接后记住该服务器,即使连接没有成功

在命令行上运行此命令:

ssh heroku.com
您将看到如下提示:

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)?
输入yes。您将无法连接到远程计算机—Heroku不允许远程登录—但ssh将记住该主机密钥,您将能够进行git推送