Connecting to Amazon EC2 from Mac OSX

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

Voila! Enjoy!

One thought on “Connecting to Amazon EC2 from Mac OSX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s