It’s Easy to Setup an SSH Connection to Your LightSail Server

I want to connect to my server so I can go play with it and get my website up. I don’t want to use their browser ssh thing because it is kind of slow.

That’s their web ssh thing. I mean, I’m pretty impressed actually that they took the time to put a console in a web browser. But, I noticed some shortcuts are not the same, and copy/paste I have to touch the mouse and eww.

Go to your account page and download your .pem file,

I do:

ssh -i ~/Downloads/LightsailDefaultKey-us-east-1.pem  bitnami@**.***.**.**

The * are just placeholders, I didn’t literally put stars there, I put my public IP address for my AWS LightSail server there.

I get this output:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0664 for '/home/me/Downloads/LightsailDefaultKey-us-east-1.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/home/me/Downloads/LightsailDefaultKey-us-east-1.pem": bad permissions
bitnami@**.***.**.**: Permission denied (publickey).

Easily fixed, we do this:

sudo chmod 600 ~/Downloads/LightsailDefaultKey-us-east-1.pem

run our ssh again and bam we’re in:

Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-1101-aws x86_64)
*** System restart required ***
___ _ _ _
| _ |_) |_ _ _ __ _ _ __ (_)
| _ \ | _| ' \/ _` | ' \| |
|___/_|\__|_|_|\__,_|_|_|_|_|

*** Welcome to the Bitnami NGINX Open Source 1.16.1-5 ***
*** Documentation: https://docs.bitnami.com/aws/infrastructure/nginx/ ***
*** https://docs.bitnami.com/aws/ ***
*** Bitnami Forums: https://community.bitnami.com/ ***
Last login: Fri Jul 10 02:12:11 2020 from 72.21.217.158
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

If all this is is a Linux machine with nginx installed on it, I am kind of wondering why I am using a cloud server at all actually.

I’m pretty comfortable in Linux land, and I’ve installed nginx before and it wasn’t difficult, so I’m hoping there’s something at the end of the rainbow here, but I guess we’ll see…

Anyway, so the reason you have to do that is so that no other users on your machine can read it except you, the current user.

Pretty simple right? No big deal.

Research and Development | Dev Ops | Software Engineer | Topaz Labs

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store