logo

SFTP Access To Amazon EC2 Using FileZilla

As soon as you've setup a Linux instance on Amazon EC2 you're likely next step is to get FTP access so you can move files about.

If, like me, your FTP tool of choice is FileZilla then this tip might save you some of the time it took me to work it out.

First of all make sure port 22 is open in your instance's Security Group in Amazon's AWS site. You can test this from a Terminal using the following command:

ssh Address-Of-EC2-Instance

If that times out then most likely port 22 isn't open. Otherwise you're ok. SFTP uses the same port so we can carry on and set it up.

If at this point you try to connect using SFTP from FileZilla you'll probably see this:

image

The error is "No supported authentication methods available". To get round it you need to tell FileZilla about  the .PEM file that was created when you built the Amazon instance. Assuming you already downloaded it to you PC, open FileZilla and select the Edit->Settings menu.

image

Click the "Add key file..." button and locate your PEM file. At this point FileZilla will ask if you want to convert it to a format it can use. Say yes and tell it where to put the new .PPK file. Once this is done press ok and try to connect again. You should have more luck!

Comments

    • avatar
    • Ferdy
    • Wed 12 Oct 2011 01:00 PM

    Nice tip, but I'm even more interested in your EC2 opinion/experience in general.

      • avatar
      • Jake Howlett
      • Wed 12 Oct 2011 02:10 PM

      Hmm. I find it all a bit confusing really. It's making me think that a vanilla hosting package might be the better option (for me at least). One where they just set it all up and give you an IP address and login and you know how much you'll be paying each month.

      Even with the EC2 cost calculator I find it a bit daunting try to even get a rough idea what I might be spending each month.

      Still, it's impressive what they've done. You just need a lot of time spare if you going to fully understand how to get the most out of it.

      Show the rest of this thread

    • avatar
    • Alex
    • Mon 31 Oct 2011 09:55 AM

    Hi Jake,

    There is no stupid question um?

    So... tell me:

    - Is it possible to deploy Domino server/apps on Amazon EC2?

    - Does it also mean that your "EC2 Apps" are then faster (for worldwide users) since they are replicated "everywhere" on the cloud?

    Alex

    1. Yes, you can deploy Domino server on EC2.

      However, that doesn't mean they're automatically replicated to all of Amazon's data warehouse locations. When you choose to create an Amazon EC2 instance you choose where it will sit (East/West America or East/West Europe).

      You could have them all around the world by creating separate instances of Domino servers at the various Amazon locations and then setting them to replicate to each other. I guess.

    • avatar
    • maddy
    • Fri 27 Jan 2012 07:23 PM

    Hi, you definitely saved a lot of time. am a newbie just got my ec2 setup, when i tried to connect through an ftp client, i saw your post luckily and it worked like a magic.

    Thanks

    • avatar
    • Yousef Alrasheedi
    • Sun 29 Jan 2012 09:18 AM

    Thanks a lot. You saved my time :)

    • avatar
    • Saed
    • Wed 22 Feb 2012 04:18 PM

    I am trying to upload an entire site that is built with PHP. I tried all your steps and I got this message

    Connecting to My amazon instance ...

    Response: fzSftp started

    Command: keyfile "C:\Users\mmusleh\Downloads\Joomla25first.ppk"

    Command: open "root@my amazon instance" 22

    Status: Connected to my amazon instance

    Error: Fatal: unable to initialise SFTP on server: could not connect

    Error: Could not connect to server

    What is your advice?

    thanks

    Saed

      • avatar
      • Sam
      • Fri 24 Feb 2012 02:15 AM

      Saed try using ec2-user instead of root.

    • avatar
    • Jack
    • Thu 3 May 2012 12:59 AM

    Jake, thank you for posting this.

    • avatar
    • Felipe
    • Fri 11 May 2012 11:10 AM

    Great!!! Tks

  1. Jake. Very helpful. Thanks!

    • avatar
    • Steve
    • Tue 20 Nov 2012 11:16 AM

    Anyone have advice here - I'm getting a simple "Conneciton timed out" error. What can I try to get this connect to work??

    Status: Connecting to myec2instance.com...

    Response: fzSftp started

    Command: keyfile "S:\Administrative\AmazonCloud_ArcGIS\PEM_To_FileZilla.ppk"

    Command: open "ec2-user@myec2instance.com" 22

    Error: Connection timed out

    Error: Could not connect to server

    Any suggestion greatly appreciated!

    Steve

      • avatar
      • james
      • Thu 13 Dec 2012 10:47 AM

      probably your security group isn't setup to allow the connection

    • avatar
    • Brian
    • Tue 26 Feb 2013 12:00 AM

    Worked with cyberduck (OSX) using the SFTP options and specifying the pem file.

    This guide saved me the time I would have spent setting up the vsftp thing that I'm reading about elsewhere.

    Thank god I stumbled upon this first before embarking on that dark journey.

    • avatar
    • Jim
    • Thu 7 Mar 2013 01:33 PM

    wasn't working for me before even after I did all these steps.

    I changed my username to root

    works now. hope this helps someone.

    • avatar
    • Zak
    • Thu 14 Mar 2013 08:03 PM

    Same issue as jim - it worked only when I changed username to root.

    • avatar
    • Al
    • Fri 15 Mar 2013 01:58 PM

    I can't get it to connect with any of the suggestions here - tho I get the same responses listed above. Used (as users) anonymous, root, ec2-user... no joy.

    I'm NEW to this. I have checked and the security group lists port 22 as ssh.

    Where the HECK do I discover a user id?

    The keypair part all worked, just will not connect.

    • avatar
    • Al
    • Fri 15 Mar 2013 02:12 PM

    Actually, here's what I get:

    Command: keyfile "C:\Users\xxxxxx\Downloads\aws stuff\ronspairkey.ppk"

    Command: open "myinstance" 22

    Command: Trust new Hostkey: Once

    Status: Connected to myinstance

    Error: Fatal: unable to initialise SFTP on server: could not connect

    Error: Could not connect to server

    Arg!

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Wed 12 Oct 2011

Share This Page

# ( ) '

Comments

The most recent comments added:

  • avatar Al about 12 years ago
  • avatar Al about 12 years ago
  • avatar Zak about 12 years ago
  • avatar Jim about 12 years ago
  • avatar Brian about 12 years ago
  • avatar james about 12 years ago

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content