简体   繁体   English

Amazon AWS EC2密钥对被拒绝

[英]Amazon AWS EC2 Key Pair Denied

I have scoured the Internet for answers and had little luck. 我已经在互联网上搜寻答案,但运气不佳。 All I have been trying to do is connect to my AWS EC2 Linux server via SSH. 我一直想做的就是通过SSH连接到我的AWS EC2 Linux服务器。

The.pem file is on my computer, but it has not been accepted. .pem文件在我的计算机上,但尚未被接受。 I have tried several FTP clients, including FileZilla and the native Terminal on my Mac. 我尝试了多个FTP客户端,包括FileZilla和Mac上的本机Terminal。

In FileZilla, my error is the following: 在FileZilla中,我的错误如下:

Error:Disconnected: No supported authentication methods available (server sent: public key) 错误:已断开连接:没有可用的受支持的身份验证方法(发送的服务器:公钥)

I also have encountered a similar message in Terminal: 我在终端机中也遇到过类似的消息:

Warning: Identity file rejectedFile.pem not accessible: No such file or directory. 警告:身份文件被拒绝File.pem无法访问:没有这样的文件或目录。 Permission denied (publickey). 权限被拒绝(公钥)。

I have quadruple-checked the file name corresponds to the one in the AWS console. 我已经四重检查了与AWS控制台中的文件名相对应的文件名。 This file was downloaded when I initialized the instance... 我初始化实例时下载了此文件...

I'd suggest you check also these two common mistakes: 我建议您也检查以下两个常见错误:

  • Wrong permissions of the .pem file: make sure the file exists with proper permissions (chmod 400) .pem文件的权限错误:确保文件存在并具有适当的权限(chmod 400)
  • Default username: use the proper username for your linux distro 默认用户名:为Linux发行版使用正确的用户名

Use the ssh command to connect to the instance. 使用ssh命令连接到实例。 You'll specify the private key (.pem) file and user_name@public_dns_name. 您将指定私钥(.pem)文件和user_name @ public_dns_name。 For Amazon Linux, the user name is ec2-user. 对于Amazon Linux,用户名是ec2-user。 For RHEL5, the user name is either root or ec2-user. 对于RHEL5,用户名是root或ec2-user。 For Ubuntu, the user name is ubuntu. 对于Ubuntu,用户名是ubuntu。 For Fedora, the user name is either fedora or ec2-user. 对于Fedora,用户名是fedora或ec2-user。 For SUSE Linux, the user name is root. 对于SUSE Linux,用户名是root。 Otherwise, if ec2-user and root don't work, check with your AMI provider. 否则,如果ec2-user和root不起作用,请与AMI供应商联系。

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM