Connect to amazon Lightsail instance via SSH using linux terminal [closed]
Asked Answered
M

2

6

How can I connect to AWS LightSail instance? AWS provides an web interface for doing this. But how can I do this with my terminal with SSH.

There are lots of documentations available for connecting from Windows with Putty.

Manage answered 11/2, 2020 at 13:3 Comment(0)
M
12
  1. Login to AWS account and navigate to Lightsail Panel
  2. At the topbar, click in Account -> Account.
  3. Navigate to SSH Keys tab.
  4. Download the SSH Keys of the instance you wish to connect.

A PEM file with such naming is downloaded (e.g. LightsailDefaultKey.pem)

  1. Move the file to a known location in your system.
  2. Modify permissions for the file with below command
     chmod 400 LightsailDefaultKey.pem
  1. Open the terminal in the same folder and use the below command.
ssh -i LightsailDefaultKey.pem user@<public-ip>

Note:

  • Only the default key for a given Region is downloadable at any time. For new keys, you can only store the PEM file when creating the key.

By the type of instance you have, use the corresponding username

  • Amazon Linux, FreeBSD, openSUSE: ec2-user
  • CentOS: centos
  • Debian: admin
  • Ubuntu: ubuntu
  • Bitnami: bitnami
  • Plesk: ubuntu
Manage answered 11/2, 2020 at 13:15 Comment(0)
M
1

use @kernelogy answer but make sure you set permission to your ssh key

chmod 400 LightsailDefaultKey.pem
Madura answered 29/3, 2022 at 15:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.