Noob question : how is the default key pair secure?

I’m new to AWS and to cloud in general, so please, forgive my ignorance.

But is the default SSH key pair that Lightsail gives you when you configure a new instance secure at all?

I guess I’m confused by the fact that a default key - which seems to be the same for the whole AWS region - is the only thing I need to access my instance by SSH… The host is public, the username are all the same, there is no password and the SSH key is the default one.

What am I missing, here? Is it that the private part of the default key is actually unique to everybody each time an instance is created?

I’m just scared that my website isn’t protected right now.


Related discussions:

There’s no way you could’ve done anything to :santa_claus:

Not sure about lightsail specifically, but ec2 keypairs are unique to an AWS account. When launching ec2 instances individually (not via lightsail) you can make one per instance or have one key pair for all of your instances but that lives inside if your account only.

The key is unique to your account and region. It’s just generated for you by AWS, but nobody else has the same key.

Yes. Private key is unique to you, thus it’s called “private”. Also, it’s your responsibility to make sure that’s remaining private.

So the “default” part is just the name of the .pem file, basically?

You have the option to import your own asymmetric key pair or have one generated by AWS. Either way, the key will remain secure as long as you take proper precautions.

I guess it’s the “default” part of the equation that’s puzzling me…

Yes, it’s just named default. The actual contents of the key are unique.

Amazing, thanks!

Oh the people that do not do private :wink: classic !

It’s definitely good that way since some people do not look what they are doing! Default in AWS is very protective from what I’ve seen.

This is less an AWS question and more of an SSH question.

You may be lacking some sysadmin fundamentals. Don’t overlook those just because you’re dealing with “the cloud.”

WRT AWS though, it’s “default” in the sense that unless you create or specify a different keypair when creating other instances in the future, that is the key that will be used. AWS uses the same terminology elsewhere as well, such as the Default VPC, or the Default Subnet, etc.

There is also a factor of time and resources to brute force the encryption algorithm. In other words, with a powerful computer it may take six months to break the encryption. So… You change keys every 3-4 months. Problem solved.

Just as an aside, assuming you used the entire computing power of the bitcoin network, it would still take multiples of the age of the universe to brute force an SSH key:

https://crypto.stackexchange.com/questions/3043/how-much-computing-resource-is-required-to-brute-force-rsa

Although, I would recommend rotating your keys at least once per big bang!

you should be using one key pair per one (each) connecting user. each user should have a different key pair and never divulge the secret half under any circumstance. the endpoint being connected to should accept as many keys as it wants to accept users.

This is very much AWS specific. Not point patronizing OP. The question is totally justified.