Ubuntu – Can Nautilus setup SSHFS like/instead of SFTP

nautilussftpsshfs

I have Nautilus set up to mount a remote filesystem using SFTP.

That works fine, so far, but SFTP seems to have some issues I find unhelpful:

  1. When I overwrite an existing text file, the group read permissions are mysteriously removed on the remote machine.
  2. When I try to attach a file to an email by dragging it to thunderbird, I get an sftp:// url which TB can't use (yet, if I open the TB attach dialogue and browse though .gvfs, all is well).

None of this happens when I manually mount the same filesystem through SSHFS. Is it possible to configure Nautilus to use SSHFS? A plugin maybe? It doesn't appear on the "Connect to Server" list of available options.

EDIT: It's been pointed out that sshfs uses the sftp protocol as a backend. While that maybe true, the real problem is that accessing files via Nautilus is less smooth than mounting via sshfs, and I'd like to figure out how to get Nautilus to do it the nice way.

Best Answer

From Wikibook OpenSSH

Another way to transfer files back and forth, or even use them remotely, is to use sshfs It is a file system client based on SFTP and utilizes the sftp-subsystem. It can make a directory on the remote server accessible as a directory on the local file system which can be accessed by any program just as if it were a local directory. The user must have read-write privileges for mount point to use sshfs.

So finally it is both the same way of communication. SSHFS uses SFTP. The difference is that sshfs is a file system driver which allows to mount a drive which allows access via SFTP. Nautilus however does not mount drives, it only shows them. You can add your Filesystem to /etc/fstab to have it mounted at boot time, however I do not suggest that as the ssh connection might not be available. Easier would be to setup a bash script which can be ran as startup application.

The behaviour described in #2 is only logical: as you have connected via SFTP only, the file you drag into thunderbird does not exist in your file system, but as a remote path.

Edit because of the comment:

Maybe I explained it not good enough. Here an example: If your remote ressource is on server fooserver and the root directory is foodir, the file is in foosubdir/foofile, then the ressource path is sftp://fooserver/foodir/foosubdir/foofile. WHen you use Nautilus SFTP, this is still the only path for you to access this file, it is remote. If you use sshfs instead, the contents of foodir become available from within your file system - sshfs is a file system driver. Then it is as if the file were stored on your harddisk. The contents of the ressource sftp://fooserver/foodir are logically mapped into your mount directory ~/.gvfs . Then thunderbird can access this file from within your local file system context as ~/.gvfs/foosubdir/foofile . Thunderbird does not even notice that it is a remote file, the sshfs file system driver integrated into the klinux kernel does abstract that for you.