linux - Install and setup FTP for nginx on Amazon EC2?

09
2013-08
  • leslie

    To install nginx and node on my Amazon EC2 I followed this guide: Installing Node.js on Amazon EC2

    Now I want to get an FTP up and running and set it up so that when I connect to the FTP I automatically land in the correct folder (that will be shown to the world by nginx).

    How can I do this?

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    osx - Mounting an Amazon EC2 instance on Mac OS X
  • user26767

    I've got public key authentication working between my Mac OS X and an Amazon EC2 instance so that from the command-line I can just type the following and it works:

    ssh root@[IPAddressOfEC2Instance]
    

    The strange thing is that I can't seem to mount the instance using "Connect to Server" in the Finder.

    I've tried typing the following server addresses into the "Connect to Server" dialog:

    ftps://[IPAddressOfEC2Instance]
    ftps://root@[IPAddressOfEC2Instance]
    

    But all I get is

    You entered an invalid username or password. Please try again.

    The root user on the EC2 instance has a blank password and I'm wondering if it has to do with that. However, I can't change the password for the root user.

    I can use an SFTP client to connect to the machine, I just can't mount it with "Connect to server". It asks for a username and password (for a registered user) and it's root/[blank] which it doesn't accept. The other option is "Guest" which brings up an empty folder in the Finder.


  • Related Answers
  • Eric Boehs

    SFTP is not the same as FTPS. FTPS is FTP using SSL. SFTP is secure file transfer protocol (over SSH). (Mac OS X's FTP/FTPS support in Finder is pretty pathetic anyways.)

    Mac OS X can not natively mount SFTP shares. There is a way to do it using MacFUSE. It's rather difficult to set up and there's not a reliable non-commercial GUI application to manage it. There are a couple packages you have to install and a lot of command line hackery to get shares to mount (don't get me started on auto mounting them). It's really not worth the effort. I have done it a couple times before, but it was hell; I have found a much better solution: ExpanDrive.

    It's a commercial program but it's worth every penny. It uses MacFUSE and allows you to mount SFTP, FTP/FTPS, and Amazon S3 "drives". You can download a free trial which works for 30 days. (Also, it won't expire unless you close it. :))

    In order to get it to work using public key pairs you'll need to add your SSH private key to your Mac OS X keychain:

    ssh-add -K
    

    Then when you create a new drive in ExpanDrive leave the password field blank, but check the "Save" box.

    You should be good to go. The great thing about ExpanDrive is it will auto reconnect the drives if the connection gets dropped (wifi drops, you sleep/wake your mac, you reboot).

  • Josh K

    You may need to enter the username and / or password in the "Connect to Server" box in finder.

    ftps://root@[IPAddressOfEC2Instance]
    

    You can alternatively use a standalone FTP application like FileZilla or Transmit.