SSH to EC2 Instance from Mac OS

1/23/2020·1 min read

This blog shows how to connect to AWS Linux or Ubuntu from Mac OS

  • First, make sure you have the EC2 Instance and have the following 2 things.
    • have the private key pair available in the Mac OS. (I.E. should be something looks like *.pem)
    • note the AWS EC2 instance public IP address
  • At mac open your terminal window and go to the location has *.pem file
  • type command as following
  • chmod 400 {yourem.pem}
  • Should be looks like this
  • chmod 400 my-test.pem
  • Following is for connecting to Linux
  • ssh ec2-user@{EC2 Public IP address} -i {YourPem.pem}
  • Should be looks like this
  • ssh ec2-user@123.123.123.123 -i my-test.pem
  • Following is for connecting to Ubuntu
  • ssh ubuntu@{EC2 Public IP address} -i {YourPem.pem}
  • ssh ubuntu@123.123.123.123 -i my-test.pem