Amazon Lightsail gives directions on how to ssh into your instance from putty, but not from ordinary ssh. How would you ssh in from MacOS or Linux?
Here's how I did it on MacOS:
(1.) Go to Account page to download the default private key
(2.) Set the permissions of the private key to be more restrictive (AWS will refuse to let you ssh with the default permission)
$ chmod 400 LightsailDefaultPrivateKey-us-west-2.pem
worked for me.
(3.) Finally, ssh into your lightsail instance. You will need the ip address for your lightsail instance, which you can get from the Amazon Lightsail frontpage.
ssh -i "LightsailDefaultPrivateKey-us-west-2.pem" ubuntu@[ip-of-lightsail-instance]
worked for me.
I lost time trying to get this to work. The keys AWS provided just didn't work. What finally did work was logging in from the browser-based terminal and adding my public RSA key to the authorized_keys file on the Lightsail instance.
Direction from Mac console:
cat .ssh/id_rsa_pub Select the text carefully so you have it all on your clipboard and nothing extra.
In the browser-based termianl session with your lightsail instance, cd .ssh cp authorized_keys autorized_keys.bak vim id_rsa_pub go into insert mode by typing i Paste the contents on your clipboard from your id_rsa_pub :wq
That's it. Now go back to your console. ssh bitnami@ < your AWS public IP address>
Enter your passphrase if you set one when creating your RSA keys and are prompted for it.
If you haven't created your RSA keys yet, check on the ssh-keygen tool.
© 2022 - 2024 — McMap. All rights reserved.