3

Trying to pull from a git repo, I get this error when doing so:

Permission denied (publickey)
fatal: The remote end hung up unexpectantly

So I try and ssh-add my keyfile, to do this I do:

eval ssh-agent
ssh-add ./bitnami/.ssh/keyFile

and get

Could not open a connection to your authentication agent

I'm sshing into an AWS EC2 with a Bitnami AMI, Ubuntu OS.

I noticed that I had several ssh-agent processes going after several different attempts at evaling my ssh-agent, so I did a

killall ssh-agent

then tried the eval, ssh-add process again, still get "Could not open..." error

PandemoniumSyndicate
  • 2,855
  • 6
  • 29
  • 49
  • What operating system are you using? Do you have access to error logs? If you're using Windows, are you using Cygwin or msysgit? Is `./bitnami/.shh/keyFile` really the correct path to your private key? are you sure it's not `./bitnami/.ssh/keyFile`? Are you sure you're adding your private and not public key? Does AWS have your public key? –  Aug 19 '13 at 17:07
  • Ubuntu OS, That's a typo for .ssh, yes it's my private key, and it's not the AWS keys, these were generated. I've managed to get this to work once using the steps above, but upon logging back onto the server at a later date, I found I could no longer interact with the remote git repo. – PandemoniumSyndicate Aug 19 '13 at 18:05

1 Answers1

1

Creating a config file at ~/.ssh/ and adding

IdentityFile ~/.ssh/keyFile

Solved the issue. This doesn't answer the above question, but it does solve the problem as a whole.

Found by attempting to ssh into the server with the -v flag helped me see that the key files were not being read (obviously).

PandemoniumSyndicate
  • 2,855
  • 6
  • 29
  • 49
  • Quick question about how you set this up: When you did 'git remote add origin...' how did you do it? I did 'git remote add origin git@linux-box:35000/opt/git/project.git' and it did not work with the config file. I set linux-box as host with the host name, port, user, and identifyfile listed. – Zeveso Nov 03 '13 at 21:26