简体   繁体   中英

Push to github from eclipse - permission denied

I need to push a branch to the remote repo from eclipse but I get permission denied when doing that. If I do this from cmd-line it works.

I have also generated a RSA Key from eclipse and add it to my github account, but the same result, I obtain permission denied when trying to push.

Had the same issue. Follow the steps below to resolve it.

  • Configure origin for your git project for github in Eclipse.

  • Generate ssh key in Eclipse and add it in your github account.

Now you will still have the issue permissions denied (publickey) .

  • Go to ~/.ssh/

Check ssh-agent is running:

user@local:~/.ssh$eval $(ssh-agent -s)

Add the key:

user@local:~/.ssh$ssh-add id_rsa

Since it was generated by Eclipse you will probably have the following message.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0664 for '/home/user/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.

In this case, change permissions of your private key:

user@local:~/.ssh$chmod 400 id_rsa

And add it again:

user@local:~/.ssh$ssh-add id_rsa

Now try in Eclipse, should resolve the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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