How do I connect to a new Amazon Lightsail instance from own computer

October 09, 2020

How do I connect to a new Amazon Lightsail instance from own computer

How do I connect to a new Amazon Lightsail instance from own computer

To be able to connect to your amazon lightsail instance you need to download the key first.

  1. Go to Accounts > SSH Keys (https://lightsail.aws.amazon.com/ls/webapp/account/keys) > Download (Make sure that you download the key for the same region where your instance is installed.)[![Manage your SSH Keys]
  2. Save it in a folder in your local machine. For Example- “Desktop > keys”
  3. Open the terminal and navigate to the directory where the key is stored(cd desktop/keys)
  4. Enter this command in terminal:chmod 600 keyfilename.pem(replace keyfile name with your actual key name e.gchmod 600 LightsailDefaultKey-eu-west-2.pem)

It is required that your private key files are NOT accessible by others. This is why we have to change the file permissions

  1. Run this commandssh -i keyfilename.pem username@ipreplace keyfilename.pem with your actual file name, username with your username(e.g bitnami or user) and replace IP with actual IP

You can find your IP and username on your instance page (https://lightsail.aws.amazon.com/ls/webapp/home/instances> Select Instance> Manage)


Written by Manoj Bhardwaj who lives and works in Mohali Punjab (India). My stackoverflow