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
To be able to connect to your amazon lightsail instance you need to download the key first.
- 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]
- Save it in a folder in your local machine. For Example- “Desktop > keys”
- Open the terminal and navigate to the directory where the key is stored(
cd desktop/keys
) - 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
- Run this command
ssh -i keyfilename.pem username@ip
replace 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)