Git ssh添加错误“;无法连接…”;即使在eval ssh代理之后

Git ssh添加错误“;无法连接…”;即使在eval ssh代理之后,git,amazon-web-services,ssh,bitnami,ssh-agent,Git,Amazon Web Services,Ssh,Bitnami,Ssh Agent,尝试从git回购中提取时,出现以下错误: Permission denied (publickey) fatal: The remote end hung up unexpectantly 因此,我尝试使用ssh添加我的密钥文件,为此,我执行以下操作: eval ssh-agent ssh-add ./bitnami/.ssh/keyFile 得到 Could not open a connection to your authentication agent 我正在进入一个AWS EC2

尝试从git回购中提取时,出现以下错误:

Permission denied (publickey)
fatal: The remote end hung up unexpectantly
因此,我尝试使用ssh添加我的密钥文件,为此,我执行以下操作:

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

Could not open a connection to your authentication agent
我正在进入一个AWS EC2和一个Bitnami AMI,Ubuntu操作系统

我注意到,在多次尝试评估ssh代理之后,我有几个ssh代理进程,所以我做了一个测试

killall ssh-agent

然后再次尝试eval、ssh add过程,仍然得到“无法打开…”错误

在~/.ssh/创建配置文件并添加

IdentityFile ~/.ssh/keyFile
解决了这个问题。这并不能回答上述问题,但它确实从整体上解决了问题


通过使用
-v
标志尝试ssh到服务器中找到,帮助我看到没有读取密钥文件(显然)

您使用的是什么操作系统?您有权访问错误日志吗?如果您使用的是Windows,那么您使用的是Cygwin还是msysgit?
/bitnami/.shh/keyFile
真的是私钥的正确路径吗?您确定它不是
/bitnami/.ssh/keyFile
?您确定要添加私钥而不是公钥吗?AWS有你的公钥吗?UbuntuOS,这是.ssh的拼写错误,是的,这是我的私钥,不是AWS密钥,这些都是生成的。我曾经通过上述步骤成功地实现了这一点,但在稍后重新登录到服务器时,我发现我无法再与远程git repo进行交互。关于如何设置的快速问题:当您执行“git remote add origin…”时,您是如何做到的?我没有远程添加源代码git@linux-框:35000/opt/git/project.git',它不能与配置文件一起工作。我将linux box设置为主机,并列出主机名、端口、用户和identifyfile。