0

I to signed in Github and clone repository from there. Then I made some corrections and commit them. When I tried push changes to the server with such command

git push origin master

I get following

Warning: Permanently added the RSA host key for IP address '192.30.252.129' to he list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository.

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

In my Github settings I see following

There are no deploy keys for this repository

ETartaren
  • 170
  • 3
  • 15

1 Answers1

0

The problem is that git is looking for the default key file when doing the push but your key file is called something different (github_rsa instead of id_rsa). This in itself isn't an issue but if you don't have mutliple keys, you could just rename it (or create a symlink to it).

If you have multiple keys, have a look at this question.

You need to set up an ssh config file (quite useful anyway) and use it to specify the key file to use. Something like

Host github
    HostName github.com
    User git
    IdentityFile /home/whoever/.ssh/github_rsa

then use github instead of [email protected] in your push command/gitconfig

Community
  • 1
  • 1
Holloway
  • 6,412
  • 1
  • 26
  • 33
  • When I tried 'git push origin master' and enter a passphrase, I get this ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '[email protected]:username/myproject.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. I did 'git pull' and repeat 'push' but got same message. – ETartaren Nov 15 '15 at 17:04
  • Did the pull compete successfully? – Holloway Nov 15 '15 at 20:13
  • Now the pull complete successfully and the push too. Thank you very much. – ETartaren Nov 16 '15 at 07:39