权限被拒绝(公钥)/致命:远程端意外挂断?

sha*_*n98 16 git ssh github

所以我使用以下命令开始制作Jekyll网站,

$ git clone https://github.com/plusjade/jekyll-bootstrap.git USERNAME.github.com
$ cd USERNAME.github.com
$ git remote set-url origin git@github.com:USERNAME/USERNAME.github.com.git
Run Code Online (Sandbox Code Playgroud)

获得本地和github repo设置后,我尝试将更改发送到github,

$ git push origin master
Run Code Online (Sandbox Code Playgroud)

找到这个,

Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

我做错了什么?我该怎么做才能解决此错误?

Lau*_*nce 16

问题是你没有用Github初始化SSH密钥.这解决了我:

cd ~/.ssh && ssh-keygen
cat id_rsa.pub 
Run Code Online (Sandbox Code Playgroud)

并将密钥复制到Github网站的SSH设置中.

然后你很高兴继续.


小智 4

权限被拒绝(公钥)意味着服务器拒绝了您的连接。检查https://help.github.com/articles/error-permission-denied-publickey了解详细信息