Using SSHFS

Using SSHFS

One of the easiest ways to access your CSE home directory from your own computer is to attach it as a network drive.

This lets you browse your files in Windows Explorer or the OSX Finder, and access them directly from any application.

To do this directly, you need to either be on the CSE wired network, or use the CSE VPN - which isn't convenient for everyone.

Luckily, there's a system called SSHFS that can attach over an SSH connection, and works from anywhere without needing a VPN.

On Windows

Setting up SSHFS on Windows is very straightforward:

  • Install WinFSP
  • Install SSHFS-Win
  • If you see a Windows SmartScreen warning, click More Information, then Run Anyway
  • Open Windows Explorer and right-click This PC
  • Select Map Network Drive...
  • Select the drive letter you want to use
  • Enter \\sshfs\yourzID@login.cse.unsw.edu.au in the Folder box
  • Tick the Reconnect at sign-in and Connect using different credentials boxes
  • Click Finish, and enter your zID and zPass when prompted.

You should now have a new drive in your computer, connected to your CSE home directory.

The drive will disconnect when your computer switches off, goes to sleep, or loses its internet connection.

When this happens, just open This PC and double-click the drive to open it - it will reconnect automatically.

Symlinks - for advanced users

If you don't know what a symlink is, you don't need to worry about this.

By default, SSHFS-Win doesn't handle absolute-path symlinks properly, as Windows will try to interpret them as paths on your own computer.

Symlink targets without a leading slash, such as current_version or ../src will work fine.

But if a link target has a leading slash, such as /home/z1234567/foo or /tmp/foo, SSHFS-Win won't follow it correctly

If you need to use absolute-path symlinks over ssh, download and install follow_symlinks.reg which will set an option to fix this.

However, if you have invalid symlinks in a directory with this option enabled, the whole directory will appear to be empty over SSHFS.

If this happens, you'll need to check the directory in a terminal with find . -maxdepth 1 -type l -exec ls -al {} \;

Just rm any links that point to nonexistent places, and the directory should be visible again

On Mac

To install on Mac:

  • Install osxfuse
  • Install SSHFS for osxfuse
  • If you're prompted about a kernel extension, follow the prompts to go to Security and Privacy and click Allow for the new software.

Now you need to create a launcher on your desktop to connect you to CSE:

  • Open Go -> Applications -> Utilities -> Terminal
  • Copy the contents of this script, paste it into the terminal and enter your zID when prompted
  • Close the terminal window.

There should now be a connect_cse icon on your desktop - double click it to connect, and enter your zPass when prompted.

(You can close the terminal window afterwards.)

You should now have a CSE drive available in Finder.

If you lose your connection at any point, double-click the launcher again to reconnect.

On Linux

This is simplest of all - SSHFS is built into the Ubuntu file browser.

  • Open the file browser
  • click + Other Locations
  • In the Connect to Server box, enter sftp://yourzID@login.cse.unsw.edu.au/home/yourzID
  • Enter your zPass when prompted
  • You should now have your CSE home directory available in the sidebar of the file browser.
Last edited by jbc 28/04/2020

Downloads on this page: