Created
November 5, 2019 11:24
-
-
Save atikbhatti/1edef1765836c7ed02f8daae1cf2b768 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download the .pem file. | |
In Amazon Dashboard choose "Instances" from the left side bar, and then select the instance you would like to connect to. | |
Click on "Actions", then select "Connect" | |
Click on "Connect with a Standalone SSH Client" | |
Open up a Terminal window | |
## Create a directory: | |
# mkdir -p ~/.ssh | |
Move the downloaded .pem file to the .ssh directory we just created: | |
# mv ~/Downloads/ec2private.pem ~/.ssh | |
Change the permissions of the .pem file so only the root user can read it: | |
# chmod 400 ~/.ssh/ec2private.pem | |
Create a config file: | |
# vim ~/.ssh/config | |
Enter the following text into that config file: | |
Host *amazonaws.com | |
IdentityFile ~/.ssh/ec2private.pem | |
User ec2-user | |
Save that file. | |
Use the ssh command with your public DNS hostname to connect to your instance. | |
e.g.: | |
# ssh ec2-54-23-23-23-34.example.amazonaws.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment