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:
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.
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!
Nice tip, but I'm even more interested in your EC2 opinion/experience in general.
Reply
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.
Reply
Hide the rest of this thread
Thanks for elaborating. I fully agree. I'm currently using Amazon S3 and Cloudfront. I like both a lot in the sense that they are simple and take away scalability, security and backup concerns. It's also great that you pay as you go, so your bill can be 1$ or 1000$ depending on usage.
A huge problem though is that you cannot put a cap on usage. A simple DDOS can financially ruin somebody sharing a public object via these services. The community at Amazon has been requesting bill capping for years now but it is still not here.
I've considered EC2 as well. I'd love for all of JungleDragon (so also the app hosting and db) to be in the cloud in an auto-scaling way, but I find EC2 to be quite expensive because it is mostly charged by hours of computing. Since you'll typically want 24/7 computing hours for web/app/db servers, even if it's not computing a damn thing, the minimal cost per month is quite high and the advantage versus fixed charge hosting packages is simply not there.
Reply
"Since you'll typically want 24/7 computing hours"
Exactly! That's one of the things that confused me in their calculator -- the "number of hours used per month". Do they mean number of hours it's turned on for or actual use? I don't get it. If it's simply whether it's on then, like you say, 24/7 please. What do they expect? That people are turning them on and off all the time? Which brings me to the confusion of the whole "terminate" thing and what they means. With the Linux instance I have the only two option are "reboot" or "terminate". There isn't an option for "off".
All a bit much for me. Just not ready for the cloud as I don't have time to learn the meanings of it all. For now I'll stick with a regular hosting package I think.
Reply
They mean the number of hours it is turned on, regardless of whether it is actually computing anything.
And yes, they kind of expect you to turn things on and off. Think of a science project, where scientists need to do a massive calculation. Rather than buying 10 super servers that they will only need for one day and sit there idle for the rest of the year, they launch EC2 instances, do the computation, and switch them of.
It makes sense in that way, but not in a web hosting situation that has a 24/7 requirement, I agree.
Reply
I don't know much about this subject ... but here's what I've read about.
I think it might be used to handle peak loads. For example you run your server on your own hardware. When the system detects that your traffic is over a certain level then it fires up your EC2 server and your load balancing system splits the traffic between the two server. If the load gets even higher then more EC2 servers can be spun up to handle it. As the traffic decreases then the EC2 servers are shut down, one by one.
http://aws.amazon.com/elasticloadbalancing/
So my impression is that EC2 is only going to be cost effective for sites with massive traffic.
Reply
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
Reply
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.
Reply
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
Reply
Thanks a lot. You saved my time :)
Reply
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
Reply
Saed try using ec2-user instead of root.
Reply
Jake, thank you for posting this.
Reply
Great!!! Tks
Reply
Jake. Very helpful. Thanks!
Reply
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
Reply
probably your security group isn't setup to allow the connection
Reply
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.
Reply
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.
Reply
Same issue as jim - it worked only when I changed username to root.
Reply
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.
Reply
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!
Reply