简体   繁体   English

无法再SSH到EC2实例:权限被拒绝(publickey,gssapi-keyex,gssapi-with-mic)

[英]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后开始出现问题,这引入了以下更改:

  1. Added config file in ~/.ssh with the following content 在〜/ .ssh中添加了具有以下内容的配置文件

    Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa

  2. I added the id_rsa into into ~/.ssh prior to step 1 我在第1步之前将id_rsa添加到〜/ .ssh中

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.

相关问题 Git权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic)? - Git Permission denied (publickey,gssapi-keyex,gssapi-with-mic)? openshift 上的权限被拒绝(publickey、gssapi-keyex、gssapi-with-mic) - Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on openshift OpenShift中的权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic) - Permission denied (publickey,gssapi-keyex,gssapi-with-mic) in OpenShift Jenkins 权限被拒绝(公钥、gssapi-keyex、gssapi-with-mic、密码) - Jenkins Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password) 权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic,密码)。 在git中 - Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). in git Jenkins 无法连接 GIT 存储库:权限被拒绝(公钥、gssapi-keyex、gssapi-with-mic、密码) - Jenkins unable to connect GIT repository: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password) 通过git ssh ec2:权限被拒绝(公钥) - ssh ec2 via git: permission denied (publickey) 亚马逊EC2 + Capistrano + Git:权限被拒绝(publickey) - Amazon EC2 + Capistrano + Git: Permission denied (publickey) 向亚马逊 ec2 推送提交时权限被拒绝(公钥) - Permission denied (publickey) when pushing commit to amazon ec2 Git SSH权限被拒绝(公钥) - Git SSH permission denied (publickey)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM