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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠