Mounting an Amazon EC2 instance on Mac OS X

7,691

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).

Share:
7,691

Related videos on Youtube

user26767
Author by

user26767

Updated on September 17, 2022

Comments

  • user26767
    user26767 over 1 year

    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.

    • Studer
      Studer about 14 years
      Did you try with ftps://root@[IPAddressOfEC2Instance] ?
    • user26767
      user26767 about 14 years
      I did try ftps://root@[IPAddressOfEC2Instance]
    • serge
      serge about 14 years
      have you enabled SFTP in your sshd_config?
    • user26767
      user26767 about 14 years
      I can use an sftp client to connect to the machine so I assume it's enabled.
  • user26767
    user26767 about 14 years
    Tried that as well... I think perhaps it has to do with the PermitEmptyPasswords ssh_config setting or similar.
  • Josh K
    Josh K about 14 years
    Can you try adding a password to the root account?
  • user26767
    user26767 about 14 years
    Unfortunately no, I can't add a password to the root account. I'm afraid to even try in case it doesn't let me remove it.
  • Josh K
    Josh K about 14 years
    Have you tried using a standalone application?
  • user26767
    user26767 about 14 years
    Yes, for example, 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.
  • Josh K
    Josh K about 14 years
    So why not just use a SFTP client?
  • leewz
    leewz about 14 years
    The cumbersome ssh-add -K and "check the save box" trick might be unnecessary. The ExpanDrive dev's are saying simply leaving the password box blank will work. (Even password protected private keys should work.)
  • leewz
    leewz about 14 years
    I just verified this and was able to connect to my SliceHost account using PKI. No password, no save box check.
  • user26767
    user26767 about 14 years
    I'm not tied to any particular protocol (ftps, sftp, etc). That being the case, is there a native way to mount an Amazon EC2 instance? If not, does your solution work for EC2?
  • Peter K.
    Peter K. over 5 years
    ExpanDrive still seems to be around and mostly appears to work for me with EC2 instances over SFTP.