Amazon ec2 当我ssh到RHEL7 AWS-EC2实例时,我得到';拒绝许可(公钥、gssapi keex、带麦克风的gssapi)和#x27;
好的,我知道以前有人问过这个问题。我尝试了所有贴在最接近的相关问题上的东西,但没有一个奏效。我以前可以登录,但现在无法。 -我尝试了ssh和Amazon ec2 当我ssh到RHEL7 AWS-EC2实例时,我得到';拒绝许可(公钥、gssapi keex、带麦克风的gssapi)和#x27;,amazon-ec2,ssh,rhel7,Amazon Ec2,Ssh,Rhel7,好的,我知道以前有人问过这个问题。我尝试了所有贴在最接近的相关问题上的东西,但没有一个奏效。我以前可以登录,但现在无法。 -我尝试了ssh和root@ipadress和ec2-user@ipaddress两者都不起作用。当我使用root时,它告诉我使用ec2用户。我正在从ubuntu 16.04下载ssh -我对我的pem文件拥有正确的权限。 -此外,我没有/etc/sshd\u special\u user文件,也不确定添加一个文件是否会起到任何作用,但在第一次失败后,它似乎会尝试对我的本地用
root@ipadress
和ec2-user@ipaddress
两者都不起作用。当我使用root时,它告诉我使用ec2用户。我正在从ubuntu 16.04下载ssh
-我对我的pem文件拥有正确的权限。
-此外,我没有/etc/sshd\u special\u user
文件,也不确定添加一个文件是否会起到任何作用,但在第一次失败后,它似乎会尝试对我的本地用户进行身份验证。-当我
ssh-keygen-f“~/.ssh/known_hosts”-R xx.xx.xxx.xxx
时,我得到mkstemp:没有这样的文件或目录
。即使文件在那里,我也能在vim中打开它。
我真的很困惑这里到底发生了什么,我将在这个问题中包含额外的详细日志文件。我通读了一遍,不知道它为什么要这样做
ssh-vvv
的输出为
-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1,OpenSSL 1.0.2g 2016年3月1日
-debug1:读取配置数据/etc/ssh/ssh\u config
-debug1:/etc/ssh/ssh\u配置第19行:应用*
-debug2:解析“52.53.159.22”端口22
-debug2:ssh\u connect\u direct:needpriv 0
-debug1:连接到52.53.159.22[52.53.159.22]端口22
-debug1:已建立连接
-debug1:key\u load\u public:没有这样的文件或目录
-debug1:identity file.ssh/RH17-06-11.pem type-1
-debug1:key\u load\u public:没有这样的文件或目录
-debug1:identity file.ssh/RH17-06-11.pem-cert type-1
-debug1:启用协议2.0的兼容模式
-debug1:本地版本字符串SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
-debug1:远程协议版本2.0,远程软件版本OpenSSH_6.6.1
-debug1:匹配:OpenSSH_6.6.1 pat OpenSSH_6.6.1*compat 0x04000000
-调试2:fd 3设置O_非块
-debug1:验证到52.53.159.22:22作为“ec2用户”
-debug3:hostkeys\u foreach:reading文件“/home/dingofarmers/.ssh/known\u hosts”
-debug3:record_hostkey:在文件/home/dingofarmers/.ssh/known_hosts:21中找到密钥类型ECDSA
-debug3:load_主机密钥:从52.53.159.22加载1个密钥
-debug3:order_hostkeyalgs:preference hostkeyalgs:ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
-debug3:发送数据包:类型20
-debug1:SSH2\u MSG\u KEXINIT已发送
-debug3:接收数据包:类型20
-debug1:SSH2\u MSG\u KEXINIT已收到
-调试2:本地客户科欣IT提案
-debug2:KEX算法:curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
-debug2:主机密钥算法:ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh rsa证书-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
-debug2:密码ctos:chacha20-poly1305@openssh.com,aes128中心,aes192中心,aes256中心,aes128-gcm@openssh.com,aes256-gcm@openssh.com、aes128 cbc、aes192 cbc、aes256 cbc、3des cbc
-debug2:密码stoc:chacha20-poly1305@openssh.com,aes128中心,aes192中心,aes256中心,aes128-gcm@openssh.com,aes256-gcm@openssh.com、aes128 cbc、aes192 cbc、aes256 cbc、3des cbc
-调试2:MACs CTO:umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
-调试2:MACs stoc:umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
-调试2:压缩CTO:无,zlib@openssh.com,zlib
-调试2:压缩stoc:无,zlib@openssh.com,zlib
-调试2:语言CTO:
-调试2:语言stoc:
-debug2:第一个_kex_跟随0
-debug2:保留0
-debug2:对等服务器KEXINIT提案
-debug2:KEX算法:curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
-debug2:主机密钥算法:ssh-rsa、ecdsa-sha2-nistp256、ssh-ed25519
-debug2:密码CTO:aes128 ctr、aes192 ctr、aes256 ctr、arcfour256、arcfour128、aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com、aes128 cbc、3des cbc、河豚cbc、cast128 cbc、aes192 cbc、aes256 cbc、arcfour、rijndael-cbc@lysator.liu.se
-debug2:密码stoc:aes128 ctr、aes192 ctr、aes256 ctr、arcfour256、arcfour128、aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com、aes128 cbc、3des cbc、河豚cbc、cast128 cbc、aes192 cbc、aes256 cbc、arcfour、rijndael-cbc@lysator.liu.se
-调试2:MACs CTO:hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-s
mkdir -p ~/.ssh
chmod 0700 ~/.ssh
ssh-keygen -f ~/.ssh/id_rsa
scp ~/.ssh/id_rsa.pub user@server.ip:~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
sudo grep -i key /etc/ssh/ssh*_config