亚马逊 AWS EC2 密钥对被拒绝

Amazon AWS EC2 Key Pair Denied

我在 Internet 上搜索了答案,但运气不佳。我一直在尝试做的就是通过 SSH 连接到我的 AWS EC2 Linux 服务器。

The.pem 文件在我的电脑上,但没有被接受。我已经尝试了几个 FTP 客户端,包括 FileZilla 和我 Mac 上的本机终端。

在 FileZilla 中,我的错误如下:

Error:Disconnected: No supported authentication methods available (server sent: public key)

我在终端也遇到过类似的信息:

Warning: Identity file rejectedFile.pem not accessible: No such file or directory. Permission denied (publickey).

我已经四重检查了文件名是否与 AWS 控制台中的文件名相对应。这个文件是我初始化实例时下载的...

我建议您也检查一下这两个常见错误:

  • .pem 文件的错误权限:确保文件存在并具有适当的权限 (chmod 400)
  • 默认用户名:为您的 linux 发行版使用正确的用户名

Use the ssh command to connect to the instance. You'll specify the private key (.pem) file and user_name@public_dns_name. For Amazon Linux, the user name is ec2-user. For RHEL5, the user name is either root or ec2-user. For Ubuntu, the user name is ubuntu. For Fedora, the user name is either fedora or ec2-user. For SUSE Linux, the user name is root. Otherwise, if ec2-user and root don't work, check with your AMI provider.

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