1 min read

Mounting Acquia locally with sshfs

Mounting Acquia locally with sshfs

One of the things that I've been working on recently as part of my MBOs with Acquia is related to learning and teaching Drupal 8. My latest self enforced task it to port the SimpleSAMLphp Authentication module and create a new and shiny D8 version. After migrating most of the routing, configuration and form structures I started to work on the business logic and get federated login working.

I've been using the free Identity Provider (IdP) provided by Feide to remove the pain of setting up my own IdP. The only caveat to this is that I needed to ensure my Service Provider (SP) is accessible from the general web; not possible when running Drupal 8 on my laptop. The quickest way for me to get a Drupal 8 ready platform that would be accessible online was to spin up a quick Acquia Freetier site and work from there. Unfortunately I would then lose the use of PHPStorm and all the benefits a solid IDE brings to Drupal 8 development.

Enter sshfs

# OSX
brew install sshfs

# RHEL
yum install fuse-sshfs

# Debian/Ubuntu
apt-get install sshfs

Create a host in ~/.ssh/config to make life simple

Host myfreetiersite
  Hostname free-xxxx.devcloud.hosting.acquia.com
  User <acquia username>
  Port 22
  IdentityFile ~/.ssh/id_rsa

Create the mount point (I'm using /tmp although anywhere owned by the user is acceptable)

mkdir /tmp/freetier

Mount Acquia freetier with the correct path and flags (Assuming livedev has been enabled)

sshfs -o reconnect,follow_symlinks,compression=yes,volname="Acquia Freetier" myfreetiersite:dev/livedev/docroot/ /tmp/freetier/

Move on with your life when you're done!

umount /tmp/freetier/