How to use SSHFS (Secure Shell Filesystem)

This article describes how to connect to your A2 Hosting account securely using SSHFS (Secure Shell Filesystem).

What is SSHFS?

The Secure Shell Filesystem (SSHFS) provides a convenient way to access remote files and directories. Using an SSHFS connection, you can browse, access, and modify files and directories on your A2 Hosting account as if they were stored on your local computer.

As its name implies, SSHFS uses SSH (Secure Shell) to communicate with the server, so all connections are encrypted and secure.

Configuring SSHFS

To set up an SSHFS connection on your computer, follow the appropriate procedure below for your computer's operating system.

Windows operating systems

The Win-sshfs application enables you to configure and use SSHFS connections on computers running Microsoft Windows. To use Win-sshfs, you must download and install the following components (some of these may be installed on your system already):

Opening an SSHFS connection

After you install the components listed above, you are ready to set up an SSHFS connection to your A2 Hosting account. To do this, follow these steps:

  1. Start Sshfs Manager.
  2. Click Add.
  3. In the Drive Name text box, type a name for the connection. The name can be anything you want.
  4. In the Host text box, type your site's domain name (for example, example.com).
    Alternatively, you can use the server name (for example, a2s78.a2hosting.com). For information about how to determine the server name for your account, please see this article.
  5. In the Port list box, type 7822.
    The default port for SSH is 22. However, A2 Hosting uses a different port for security reasons.
  6. In the Username text box, type your A2 Hosting account username.
  7. In the Authentication method list box, select Password.
    You can also use SSH keys to authenticate to the server. To do this, you must first generate a key pair and configure the server. For information about how to do this, please see this article.
  8. In the Password text box, type your A2 Hosting account password.
  9. In the Directory list box, type a single period (.).
  10. In the Drive Letter list box, select the letter that you want to assign to the mounted drive.
  11. If you want Win-sshfs to connect to the account automatically every time you log in, select the Mount at login check box.
  12. Click Save. Sshfs Manager saves the connection information.
  13. Click Mount. Win-sshfs tries to open a connection to the server:
    • If the connection is successful, the Mount button changes to Unmount. Use Windows Explorer or My Computer to open the drive that you specified in step 10. You can browse your A2 Hosting account and work with the remote files as if they are stored on your local computer.
    • If the connection is unsuccessful, Sshfs Manager displays an error message. Check the settings that you provided in steps 4 to 10, and then try again.
  14. To close the SSHFS connection when you are done, click Unmount in the Sshfs Manager.
Mac OS X

To set up and use SSHFS connections on Apple Mac OS X, you must install the following components:

  • FUSE for OS X
  • SSHFS
Installing FUSE for OS X

To install FUSE for OS X, follow these steps:

  1. Use your web browser to go to https://osxfuse.github.io.
  2. Under Stable Releases, download and save the OSXFUSE 2.7.0 file on your computer.
    At the time this article was published, the most recent version was OSXFUSE 2.7.0. If there is a newer version available, download that version instead.
  3. Double-click the osxfuse-2.7.0.dmg file. The FUSE for OS X dialog box appears.
  4. Double-click Install OSXFUSE 2.7.pkg.
  5. Accept the default values by clicking Continue.
  6. Click Install, and then type your password. When the installation is finished, The installation was successful appears.
Installing SSHFS

To install SSHFS, follow these steps:

  1. Use your web browser to go to https://osxfuse.github.io.
  2. Under Stable Releases, download and save the SSHFS 2.5.0 file on your computer.
    At the time this article was published, the most recent version was SSHFS 2.5.0. If there is a newer version available, download that version instead.
  3. Double-click the sshfs-2.5.0.pkg file. The Install SSHFS 2.5.0 dialog box appears.
  4. Accept the default values by clicking Continue.
  5. Type your password when you are prompted to do so. When the installation is finished, The installation was successful appears.
Opening an SSHFS connection

After you install OSX Fuse and SSHFS, you are ready to open a connection to your A2 Hosting account. To do this, follow these steps:

  1. Open a terminal window. To do this, click Applications, click Utilities, and then click Terminal.
  2. At the command prompt, create a directory where you can mount the remote filesystem. In this procedure, we'll use a directory path named mnt/a2 in the user's home directory:
    mkdir -p ~/mnt/a2
  3. To open an SSHFS connection to your A2 Hosting account, type the following command. Replace username with your A2 Hosting username, and replace example.com with your site's domain name:

    sshfs -p 7822 username@example.com:/home/username ~/mnt/a2
    • The default port for SSH is 22. However, A2 Hosting uses a different port for security reasons.
    • You can use the server name (for example, a2s78.a2hosting.com) instead of your domain name. For information about how to determine the server name for your account, please see this article.
  4. Type your password when you are prompted to do so.

    If you do not want to type your password every time you open a connection to the server, you can configure SSH keys. For information about how to do this, please see this article.
  5. Open the directory that you created in step 2 (in our example, ~/mnt/a2) using the command line or the OS X Finder. You can browse your A2 Hosting account and work with the remote files as if they are stored on your local computer.
  6. To unmount the SSHFS connection, right-click the volume name in the Finder, and then click Eject.

    Alternatively, you can unmount the SSHFS volume from the command line by using the umount command. For example:

    umount ~/mnt/a2
Linux operating systems

To set up and use SSHFS connections on a computer running Linux, you must first install the appropriate package for your distribution.

Installing the SSHFS package

To install the appropriate SSHFS package for your distribution:

  • For CentOS and Fedora, type the following command:
    yum install fuse-sshfs
    To download and install the fuse-sshfs package, you must have the EPEL (Extra Packages for Enterprise Linux) repository enabled for your system. For more information about this repository, please visit https://fedoraproject.org/wiki/EPEL/FAQ.
  • For Debian and Ubuntu, type the following command:

    apt-get install sshfs
Opening an SSHFS connection

After you install the SSHFS package on your computer, you are ready to set up a connection to your A2 Hosting account. To do this, follow these steps:

  1. Open a terminal window. The exact steps to do this depends on the Linux distribution and desktop environment you are using.
  2. At the command prompt, create a directory where you can mount the remote filesystem. In this procedure, we'll use a directory path named mnt/a2 in the user's home directory:
    mkdir -p ~/mnt/a2
  3. To open an SSHFS connection to your A2 Hosting account, type the following command. Replace username with your A2 Hosting username, and replace example.com with your site's domain name:

    sshfs -p 7822 username@example.com:/home/username ~/mnt/a2
    • The default port for SSH is 22. However, A2 Hosting uses a different port for security reasons.
    • You can use the server name (for example, a2s78.a2hosting.com) instead of your domain name. For information about how to determine the server name for your account, please see this article.
  4. Type your password when you are prompted to do so.

    If you do not want to type your password every time you open a connection to the server, you can configure SSH keys. For information about how to do this, please see this article.
  5. Open the directory that you created in step 2 (in our example, ~/mnt/a2) using the command line or your desktop environment's file manager. You can browse your A2 Hosting account and work with the remote files as if they are stored on your local computer.
  6. To unmount the SSHFS connection, use the umount command:

    umount ~/mnt/a2

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.