[英]Cannot ssh into EC2 instance anymore: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
I was using ssh client from mac to log into the EC2 instance and it was working fine: 我从Mac使用ssh客户端登录到EC2实例,并且运行良好:
ssh -i "key.pem" centos@10.193.80.253
I have started getting issues after I tried configuring ssh for git in the EC2 which introduced following changes: 我尝试在EC2中为git配置ssh后开始出现问题,这引入了以下更改:
Added config file in ~/.ssh with the following content 在〜/ .ssh中添加了具有以下内容的配置文件
Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa
I am not sure if these changes are causing any issues. 我不确定这些更改是否会引起任何问题。
Assuming you are using github I suggest making that host specific. 假设您使用的是github,我建议使该主机特定。
ie cat ~/.ssh/config 即猫〜/ .ssh / config
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
If you are still having issues after this change you can debug your EC2 issue with ssh -vvv -i "key.pem" centos@10.193.80.253
如果此更改后仍然存在问题,则可以使用ssh -vvv -i "key.pem" centos@10.193.80.253
调试EC2问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.