I saw all kinds of posts saying that ssh in Mac doesn’t read Amazon’s key file. That’s just bogus. I did have some struggles but I got things to work.
First, copy the key file, say demokey.pem, on the hard drive somewhere. I normally carry the key file in a USB drive. It will not work from a USB drive! That’s where I wasted a lot of time.
Then change the permission of the key file:
chmod 400 demokey.pem
Then, run ssh:
ssh -i demokey.pem root@YOUR_EC2_INSTANCE_HOSTNAME
Similarly, copy files using scp:
scp -i demokey.pem somefile.txt root@YOUR_EC2_INSTANCE_HOSTNAME:/root