Server refused your key error prevents SSH from connecting to the EC2 instance

Asked 2 years ago, Updated 2 years ago, 110 views

About AWS SSH Connections

·Current status
We have signed an AWS EC2 contract.The instance started successfully.
Allows SSH on security inbound and specifies its own IP address.
Created a key pair.Downloaded the pem file.

·What you want to do
I want to make SSH and SFTP connections to AWS.

·Situation and questions
Loaded the pem created in AWS and created a private key.
I tried to make an SSH connection with putty while browsing AWS Help.
After entering the username, the
Server refused your key message appears. SSH connection failed as indicated by Putty.


To create a private key, follow these steps: https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/putty.html
See
I set up the ppk file when connecting on the putty side, but as mentioned above
SSH connection is not successful when prompted.

The hostname and port number were not invalid when the SSH connection was attempted.
Which part should I check?

aws ssh amazon-ec2

2022-09-29 21:22

1 Answers

Verify that the username is correct.

  • Amazon Linux AMI:ec2-user
  • RHELAMI:ec2-user or root
  • Ubuntu AMI:ubuntu or root
  • Centos AMI:centos
  • Fedora AMI:ec2-user
  • SUSE:ec2-user or root
  • Non-above: Check with the AMI creator


2022-09-29 21:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.