How to connect Mac terminal with EC2 instance
Solution 1
You need to know the .pem file folder you download, and then follow steps below:
- download the keypair(.pem file)
- cd to keypair(.pem file) location (Note that you can use absolute path name for key pair instead)
- chmod 400 [your_key_name].pem (Note that to make SSH work, your key must not be publicly viewable. Use this command if needed.)
- ssh -i "[your_key_name].pem" ec2-user@[your ec2 dns name]
Solution 2
You will have to convert your "ppk" file to "pem" file follow this steps.
After you convert connect to the instance using the SSH command and converted "pem" file.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
Related videos on Youtube
ENIO MARKU
Updated on September 14, 2022Comments
-
ENIO MARKU over 1 year
I am using mac terminal and I want to connect my machine with server instance EC2 in aws with SSH. Since I am using Mac OS X is not necessary to use PUTTY. The problem is that when I download the key it is with extension .ppk but when i need to run it on terminal i need to use a command in which i have to use .pem extension . I tried to run it in that way and it said to me permission denied. Can someone help me what to do in this case? Do i have to change the permission or to convert my key from .ppk to .ppm?
-
error2007s over 7 yearsThis is not the correct answer the use has a PPK file it needs to be converted to PEM first then the above steps will work.
-
Hashim Akhtar about 2 yearsOn a mac you can also right click the file, go to "Get Info" remove permissions for "Staff", set "Everyone" to "No Access" and make sure no one other than you is there.