---
title: Mounting an EC2 instance in Transmit
author: George Mandis <george@mand.is>
date: 2011-02-18
description: How to mount your EC2 instance using Transmit (Or any SFTP client)
tags: post
---

**Update:** If you look closely, you'll notice a little button with a key icon on it next to the place you enter your password when setting up a new Transmit connection.  You can click on this and specify [yourkey].pem, as noted later in these instructions.  Probably more useful than the command-line approach for people who are strictly interested in getting up and running Transmit.

Thought this would be useful for anyone who wants to mount his or her <acronym title="Elastic Compute Cloud">EC2</acronym> client in [Transmit](http://www.panic.com/transmit/) or [Cyberduck](http://cyberduck.ch/) without setting up an <acronym title="File Transfer Protocol">FTP</acronym> server, users, passwords and the like.

Logging into your <acronym title="Elastic Compute Cloud">EC2</acronym> instance
---

When you initially create your <acronym title="Elastic Compute Cloud">EC2</acronym> instance you can get the command line you need to <acronym title="Secure Shell">SSH</acronym> into it via the <acronym title="Amazon Web Services">AWS</acronym> console.  You can retrieve this by going to the <acronym title="Elastic Compute Cloud">EC2</acronym> tab in your <acronym title="Amazon Web Services">AWS</acronym> console.  To do this, select the instance you want to log into from the <acronym title="Elastic Compute Cloud">EC2</acronym> tab in the <acronym title="Amazon Web Services">AWS</acronym> console and  go to *Instance Actions &raquo; Connect*.  


You should see an overlay that shows the command line you can use to log into your instance.


For Linux instances it should look something like this:

<code>ssh -i [yourkey].pem root@ec2-xxx-xxx-xxx.com</code>

You have to be in the same directory as <code>[yourkey].pem</code>, but typing this at the command-line will log you into your <acronym title="Elastic Compute Cloud">EC2</acronym> instance.

Connect using an <acronym title="Secure File Transfer Protocol">SFTP</acronym> client
---

To make your <acronym title="Elastic Compute Cloud">EC2</acronym> instance accessible from a client like Transmit or Cyberduck, Go to the directory where your key is stored (Typically <code>~/.ec2</code>, I think) and type in: 

<code>ssh-add [yourkey].pem</code>

That's it!  Now you can setup a new connection in Transmit:

- Add a new favorite
- Be sure to specify it's an <acronym title="Secure File Transfer Protocol">SFTP</acronym> connection
- The username should be 'root' (Or possibly something else depending on your setup)
- enter the long <acronym title="Elastic Compute Cloud">EC2</acronym> domain [ec2-xxx-xxx-xxx.com] for the server.
- Leave the password field blank

It should look something like this (in Transmit):

Click save and test out your connection.  Voila! You should be able to connect and see the home directory in the remote pane.
	
This also means you don't have to use the -i switch on the command line when you <acronym title="Secure Shell">SSH</acronym> into your instance.  You can just type:

<code>
ssh root@ec2-xxx-xxx-xxx.com
</code>

Making the command simpler
--

If you want to make logging in from the command line even simpler, you can add this to your <code>~/.ssh/config</code> file:

<code>
**Host** myec2instance   
**HostName** ec2-xxx-xxx-xxx.com   
**User** root
</code>

Now from the command-line you should be able to log into your instance by simply typing:

<code>ssh myec2instance</code>

Isn't that nice?