-1

I completed building a website using ReactJs & node. trying to host it on aws lightsail. When I tried to connect server with SSH key (from lightsail) in Putty, the error occurs as below.

"Server refused our key"

I tried to follow all the step from this amazon lightsail docs when working on Putty: https://lightsail.aws.amazon.com/ls/docs/en/articles/lightsail-how-to-set-up-putty-to-connect-using-ssh

Anyone experienced this issue, please help! Thanks

Phung Pham
  • 31
  • 2
  • 6

3 Answers3

0

Check out if you are using the correct key pair. On the AWS console click on the instance, and on the first tab(Connect) there should be a sentence like "You configured this instance to use default (us-east-1) key pair."

Unfortunately if you lost the key you cant download it again. It is easier to just delete the instance and create a new one, in the process you will be able to download the correct key.

tiago
  • 23
  • 3
0

Before connect please make sure ownership of the key into the user directory.

For example: if you are using ubuntu as username and this path for your authorized key /home/ubuntu/.ssh/authorized_keys.

Set owner of this file to Ubuntu, using following command:

sudo chown ubuntu:ubuntu /home/ubuntu/.ssh/authorized_keys

I am sure that will fix your issue.

Eduardo Baitello
  • 10,469
  • 7
  • 46
  • 74
0

You can go to profile and download the default key-pair and try connecting with that, also you can check what user you are using. Normally for node, "bitnami" is the user.