Get Please login as the user "ec2-user" rather than the user "root" error after connecting EC2 for several days

0

Hi,

I keep getting this error after creating my EC2 instance and control it using ssh key pair for a while. This has happened 2 times. Last time I had to create a new instance and mount it to the existing EBS volume to recover the data. Command to ssh using Windows Terminal:

ssh -i "C:\Users\Dell\.ssh\my-key-name.pem" ec2-user@myserver.com

Got:

Please login as the user "ec2-user" rather than the user "root". Connection to myserver.com closed.

I can still ssh using EC2 Instance Connect. Thanks for helping out.

Yulong
已提問 9 個月前檢視次數 635 次
1 個回答
0

Have you tried reviewing the EC2 logs? I'd start there, given you can connect with EC2 instance connect:

/var/log/auth.log (Ubuntu)

/var/log/secure (Amazon Linux, CentOS)

profile pictureAWS
已回答 9 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南