1

I have seen a lot of threads with same issue and I followed most of them but none of them resolved my issue. I am using git version 2.3.8 (Apple Git-58) on my mac(OSX 10.10.5). I have a script which clones my repo and deploys it on an EC2 instance. This set-up(script) is well tested and I have previously deployed with the same script multiple times without having any issue. Recently I changed my system and have the above configuration. Now, when I try to run the same(unchanged) script to deploy my application I get

Permission denied (publickey)

  1. I am able to pull/push to my git repo without any problem.
  2. I have setup my ssh-key configuration and also I get successful output when I run this command : ssh -T git@github.com
  3. Since I have deployed the application on the EC2 host previously hence my ssh-keys are in sync on my host and Github (I have cross verified it also).
  4. I cloned my repo using HTTPS URL while my script has SSH URL, I though it could be the issue and I tried to alter the URLs from SSH to HTTPs**(git remote set-url origin)** also but still did not work and I am still getting permission denied issue.
  5. I am able to login to my host using the same key which I am using to deploy, so I am assuming it is not an AWS( EC2) issue.

I am pretty sure that the issue has come up because of my changed setup i.e GIT and OS but not able to figure out. After doing a lot of googling and trying a lot of things I am still stuck at this issue.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
viks1010
  • 101
  • 8
  • weird, especially given what you wrote in bullet 1 and 2. Can you show exactly which command fails in your setup script? From what I read, I guess it's the `git clone` command but ... – tgo Sep 29 '15 at 14:51
  • @tgo, it is the git fetch --all command which is failing. The script clones the repo to my EC2 Instance. Previously I have deployed my application successfully using the same script and it has not been changed at all. – viks1010 Sep 30 '15 at 06:48
  • the only thing which comes to mind is to trace whatever happens at the ssh level when you do the `git fetch`, in essence mimicking the `ssh -vvv` that I would use to debug that kind of problem. See here http://stackoverflow.com/questions/25388499/how-can-i-run-git-push-pull-commands-with-ssh-verbose-mode for a solution to that. If you can share the result maybe we will find why your key is not accepted. – tgo Sep 30 '15 at 07:48

0 Answers0