Permission Denied (publickey)/fatal: The remote en

2019-02-02 14:09发布

问题:

So I started the production for a Jekyll site using the following commands,

$ 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

After getting a local and github repo set up, I tried to send the changes to github,

$ git push origin master

to find this,

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

What did I do wrong? What can I do to resolve this error?

回答1:

Permission denied (publickey) means that that the server rejected your connection. Check https://help.github.com/articles/error-permission-denied-publickey for details



回答2:

The problem is that you haven't initialized SSH keys with Github. This solved it for me:

cd ~/.ssh && ssh-keygen
cat id_rsa.pub 

and copy the key into the SSH settings of the Github website.

Then you're good to continue.



回答3:

You create SSH From Github Account.
https://help.github.com/articles/generating-ssh-keys



回答4:

If you are pushing large files then try this, It will change the pushing capacity to 500 MB

$ git config http.postBuffer 524288000 

or try this, set the origin to master

$ git push origin master 

or Check your proxy setting of internet connection.If you are using some proxy then change it to noproxy. git push will work in noproxy mode.



标签: git github ssh