September 14th, 2011

Mapping an EC2 instance to a local drive on Mac

If you’re already using EC2, you’re probably familiar with SSH’ing to your box via Terminal with something like this:

ssh -i your_ec2_pem.pem your_ec2_instance_username_like_ubuntu@your_ec2_host.com

But did you know you can avoid this by creating a ~/.ssh/config file with details like this (obviously replacing the values with your specific EC2 details):

Host your_ec2_host
HostName your_ec2_hostname
User your_ec2_instance_username_like_ubuntu
IdentityFile ~/Downloads/your_ec2_pem.pem

Now when you want to SSH into your app, you can just open terminal and type something like:

ssh your_ec2_host

Nice…but let’s go one step further. Wouldn’t it be nice to just map your EC2 instance to your local machine as a network drive? Here’s how:

1. Download and install OSXFuse from the github project -> https://github.com/osxfuse

2. Download and install Macfusion from http://macfusionapp.org

3. Open Macfusion and create a new mapping (once you’ve created the config file from above, you can just enter the same details from that for your mapping and Macfusion magically figures out to use the pem file)

And that’s it…you should now have a Drive mapped on your local computer that you can open, explore, and interact with just like any other directory. Cool!

Note: Older macs may need/want/prefer to use Macfuse instead of OSXFuse…I’m currently running Lion, so I needed 64 bit support and therefore had to use OSXFuse.

Note: Though awesome that you can map drives like this, it can sometimes be slow access…so I highly recommend you adjust the preferences in Macfusion to have a lengthy timeout on mounting (I personally use 45 seconds)

Note: Once your drive is mapped, you do not need to keep Macfusion open/running. The mapping will remain until you restart or specifically unmount it.

  1. vijaysailappan reblogged this from falicon
  2. kiddyworld reblogged this from falicon
  3. macminin reblogged this from falicon
  4. howardtharp reblogged this from falicon and added:
    seconds)” Thanks so much for writing this up.
  5. thekeith reblogged this from falicon
  6. falicon posted this