Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services AWS EC2 Instance无法连接ssh_Amazon Web Services_Ssh_Amazon Ec2_Key - Fatal编程技术网

Amazon web services AWS EC2 Instance无法连接ssh

Amazon web services AWS EC2 Instance无法连接ssh,amazon-web-services,ssh,amazon-ec2,key,Amazon Web Services,Ssh,Amazon Ec2,Key,我的公司里有人搞得一团糟,在这个实例上使用了一些权限。 我想我设法恢复了它们,但是的,我无法通过SSH连接。 我看到了所有的文档更改,因为他们建议我的.ssh文件夹和与之联系的文件的权限。 但仍然没有成功 以下是调试中看到的内容: debug1: Host '[ec2-35-158-36-123.eu-central-1.compute.amazonaws.com]:922' is known and matches the RSA host key. debug1: Found key in

我的公司里有人搞得一团糟,在这个实例上使用了一些权限。 我想我设法恢复了它们,但是的,我无法通过SSH连接。 我看到了所有的文档更改,因为他们建议我的.ssh文件夹和与之联系的文件的权限。 但仍然没有成功

以下是调试中看到的内容:

debug1: Host '[ec2-35-158-36-123.eu-central-1.compute.amazonaws.com]:922' is known and matches the RSA host key.
debug1: Found key in /home/mobaxterm/.ssh/known_hosts:33
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: mobilePortalDev.pem (0x0), explicit
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic
debug3: preferred hostbased,publickey,password,keyboard-interactive
debug3: authmethod_lookup publickey
debug3: remaining preferred: password,keyboard-interactive
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: mobilePortalDev.pem
debug3: sign_and_send_pubkey: RSA SHA256:q1Dv2WPu+7ivOPemq0J1zaZdLyekni8URMGn1+zo7Aw
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
我只使用密钥验证。 我想可能是锁着的或不可写的,所以它无法拿到钥匙


Cab有什么帮助吗?

您是否尝试将公钥放置在授权密钥文件中,并为您的用户授予其完全权限


/home/username/.ssh/authorized_keys

您可以共享~/.ssh上的权限吗?您的用户id应该拥有主文件夹中的文件夹.ssh,该文件夹中的所有文件(包括该文件夹)都应有600个权限。我假设授权密钥已经存在,并且有人使用了您提到的权限