SSH访问Amazon EC2实例时权限被拒绝(publickey)[关闭]

当尝试SSH访问Amazon EC2实例时遇到'Permission denied (publickey)'错误,可能的原因包括使用错误的密钥对、用户名或主机。确保使用正确的用户名(如ec2-user或ubuntu),检查.pem文件,并确认安全组配置允许SSH流量。如果密钥对丢失,需创建新实例并使用新密钥对。等待几分钟再尝试连接有时也能解决问题。
摘要由CSDN通过智能技术生成

本文翻译自:Permission denied (publickey) when SSH Access to Amazon EC2 instance [closed]

I want to use my Amazon ec2 instance but faced the following error: 我想使用我的Amazon ec2实例,但遇到以下错误:

Permission denied (publickey).

I have created my key pair and downloaded .pem file. 我创建了密钥对并下载了.pem文件。

Given: 鉴于:

chmod  600 pem file.

Then, this command 然后,这个命令

ssh -i /home/kashif/serverkey.pem  ubuntu@ec2-54-227-242-179.compute-1.amazonaws.com

But have this error: 但有这个错误:

Permission denied (publickey)

Also, how can I connect with filezilla to upload/download files? 另外, 如何连接filezilla上传/下载文件?


#1楼

参考:https://stackoom.com/question/1Fq6e/SSH访问Amazon-EC-实例时权限被拒绝-publickey-关闭


#2楼

This error message means you failed to authenticate. 此错误消息表示您无法进行身份验证。

These are common reasons that can cause that: 这些是导致这种情况的常见原因:

  1. Trying to connect with the wrong key. 试图用错误的密钥连接。 Are you sure this instance is using this keypair? 你确定这个实例正在使用这个密钥对吗?
  2. Trying to connect with the wrong username. 试图用错误的用户名连接。 ubuntu is the username for the ubuntu based AWS distribution, but on some others it's ec2-user (or admin on some Debians, according to Bogdan Kulbida's answer)(can also be root , fedora , see below) ubuntu是基于ubuntu的AWS发行版的用户名,但是对于其他一些ec2-user来说,它是ec2-user
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值