How to connect to a new Amazon LightSail node via ssh in one command

ssh -i /path/to/private-key.pem username@public-ip-address
mv ~/Documents/LightsailDefaultKey-us-west-2.pem ~/.ssh
Go to your terminal again:cd ~/.sshvi config# Once you are in this file create a new Host blockHost my-server
HostName domain-or-ip-goes-here
User bitnami
PreferredAuthentications publickey
IdentityFile ~/.ssh/LightsailDefaultKey-us-west-2.pem
ssh my-server




Software Engineer, Networking, Technology

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to create a Singleton class in Kotlin

Localstack Kinesis Firehose + AWS CDK

CS373 Fall 2021: Week 13

Bedrock Minecraft PLUS

How To Reduce Your Tests Boilerplate

How to create custom stackable toasts

Import Excel data in the database: Symfony Back-End

How To Create A Plan For Learning To Code

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


Software Engineer, Networking, Technology

More from Medium

Implementing RDS IAM authentication in a PHP/MySQL application

How to Setup a PHP-based AWS Lambda function

Reviving data from a legacy Firebird database

How to Secure Your Website on Linux?