Skip to content

pkboom/cloudcasts-vpc-basics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log into public ec2

ssh -i ~/.ssh/<instance-key>.pem ubuntu@<ec2-public-instance-ip>

Log into private ec2

You should log into the private ec2 from the private ip addess, which means you should log into public ec2 first. And then from there, log into the private ec2.

  1. Copy private key
cat ~/.ssh/<private-key-of-private-ec2>.pem | pbcopy
  1. Log into public ec2
  2. Create a pem.
vim ~/.ssh/<private-key>.pem
# :set paste in vim to paste private key
# :wq
  1. Log in
ssh -i ~/.ssh/<private-key>.pem ubuntu@<ec2-public-instance-ip>

Error

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@ WARNING: UNPROTECTED PRIVATE KEY FILE! @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Permissions 0640 for '/home/y/.ssh/.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/y/.ssh/.pem": bad permissions

If you get this error, run below:

chmod 0600 <instance-key>.pem

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages