无法从Windows通过SSH连接AWS RHEL实例的问题求助
AWS RHEL实例Windows SSH连接失败(Permission denied)
问题详情
执行以下SSH命令连接AWS RHEL实例:
c:\Users\simon\Downloads>ssh -i "Mega3.pem" ec2-user@ec2-13-210-225-73.ap-southeast-2.compute.amazonaws.com
返回错误:
ec2-user@ec2-13-210-225-73.ap-southeast-2.compute.amazonaws.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
已排查操作
- 在存放创建实例时生成的密钥文件
Mega3.pem的Downloads目录下启动SSH - 已将密钥文件权限设置为仅当前账户拥有完全控制权限
- 安全组已添加规则允许ICMP(ping)访问,规则配置为来源0.0.0.0/0
SSH详细调试日志
OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3 debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug1: Connecting to ec2-13-210-225-73.ap-southeast-2.compute.amazonaws.com [13.210.225.73] port 22. debug1: Connection established. debug1: identity file Mega3.pem type -1 debug1: identity file Mega3.pem-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.6 debug1: Remote protocol version 2.0, remote software version OpenSSH_8.7 debug1: compat_banner: match: OpenSSH_8.7 pat OpenSSH* compat 0x04000000 debug1: Authenticating to ec2-13-210-225-73.ap-southeast-2.compute.amazonaws.com:22 as 'ec2-user' debug1: load_hostkeys: fopen C:\\Users\\simon/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ssh-ed25519 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ssh-ed25519 SHA256:vDtm+N1kYnIhhqQ61Rj8d5UKT2IoVbFSir7B4IDaDUM debug1: load_hostkeys: fopen C:\\Users\\simon/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory debug1: Host 'ec2-13-210-225-73.ap-southeast-2.compute.amazonaws.com' is known and matches the ED25519 host key. debug1: Found key in C:\\Users\\simon/.ssh/known_hosts:6 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory debug1: Will attempt key: Mega3.pem explicit debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Next authentication method: publickey debug1: Trying private key: Mega3.pem debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: No more authentication methods to try. ec2-user@ec2-13-210-225-73.ap-southeast-2.compute.amazonaws.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
内容的提问来源于stack exchange,提问作者SimonKravis
相关产品推荐
相关产品推荐

