Lightsail SSH not working!

0

Hi,

I had an instance of lightsail running with ubuntu for 3 months without any issue. Developers and I were able to access via SSH.

About a week ago we could no longer connect. Initially not even the lightsail browser version would work (immediately disconnecting).

After doing some research online I decided to create a new instance from a snapshot. That made SSH connection via browser work again. But unfortunately Putty still returns "Server refused our key". Tried downloading the keys again, creating new keys, uploading my own key. Nothing worked.

Any help will be highly appreciated.

Fadmin
asked 5 years ago3396 views
9 Answers
0

Hello,
Thank you for using Lightsail.

Here are some ideas to help debug:

  • Navigate to the "Connect" tab of the instance and verify that the key pair name in bold below the "Connect using your own SSH client" section is the same as the one you've downloaded and are attempting to use to connect.
  • Ensure the .pem key has the correct permissions set, otherwise the server will refuse connection. On Linux or Mac you can set the correct permissions with the following command chmod 400 ~/key-name.pem. Details for connecting with Putty as you mentioned can be found here: https://docs.aws.amazon.com/quickstarts/latest/vmlaunch/step-2-connect-to-instance.html

Let us know if either of those helps, or if you are still stuck connecting.

Regards,
Jonathan

AWS
answered 5 years ago
0

unfortunally, i have the exactly same issue... i tried to change the keys, restart the computer - change the computer - always the same error "server refused our key" - the only thing which works is the ssh client via browser - no connection via sftp or navicat/mysql as before (it worked well, till i destroyed the apache conf files...) therefore i terminated the old instance and build a new one - then the ssh putty client stopped connecting

any ideas - there is nothing out in the internet - not for this problem - is that a lightsail problem??

pardium
answered 5 years ago
0

Have you attempted to update the permissions as mentioned above by JonathanH-AWS?

Are there any additional details you can provide regarding the error message that you are seeing?

In order to get a clearer understanding of what may be happening, you can try editing your /etc/ssh/sshd_config file and change the log level to

LogLevel DEBUG3

Once you have done so and after you attempt to connect again, more specific errors should be output to

/var/log/secure

Regards,

Jordan

answered 5 years ago
0

I have the same problem on osx. Permissions are correct, and using -v option, I can see it cycling through all the keys, and none of them work. I also tried using the default key, although the lightsail console for the instance shows it as being associated with the custom key. (key was generated during the instance creation; not an uploaded key). I cannot get into the instance except for the "lacking" web shell console, and cannot run many commands without getting some weird 404 response which terminates the session.

wkhatch
answered 5 years ago
0

same problem since weeks.
still no change. "Server refused our key"
I have another LAMP instance, where everything is working well

answered 4 years ago
0

Still stuck connecting
No change at all. Each trial same result. Really need serious help.
why is my first instance working smoothly from the beginning (in the same region), the new one absolutely not?
The first LAMP is based on UBUNTU, the second one on DEBIAN.
So maybe user - name is changed from ubuntu to admin.
But has nothing to do with "server refused our key"
As you wrote: "...key pair name in bold below the "Connect using your own SSH client" section is the same as the one you've downloaded.."
its...-eu-central-1 ... so correct!
What can I do?

answered 4 years ago
0

This is not really helpful
/etc/ssh/sshd_config results in : Permission denied
Thank you very much!

Edited by: Edgar1004 on Sep 26, 2020 7:19 AM

answered 4 years ago
0

I found the solution and would like to share this message to all of you who had same problem, desperately searching for solving.
Lightsail LAMP doen't come now based on UBUNTU, it's based now - without any announcement - on DEBIAN
Here is the crux.
DEBIAN asks for another User-name and this is not "admin" like you see in the discription. It is "bitnami"
And voila... it works

answered 4 years ago
0

I think you should check this pattern which is discussed in the documentation here: https://aws.amazon.com/premiumsupport/knowledge-center/lightsail-resolve-ssh-console-errors/ .

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions