Ubuntu And SSH File Access In the File Explorer

When it comes to file access over the Internet, Windows Shares (SMB) are a no-go as file transfers are not encrypted and the ports used by the protocol are often blocked by Internet providers. Webdav shares are often also not practical. Therefore I’ve used SCP in the past on the command line to transfer individual files from any place in the remote file system. The problem with this is that for many tasks the command line is way to cumbersome to use. But did you know that the Ubuntu file explorer can use SSH/SCP/SFTP to connect to a remote file system and bind it locally?

It’s actually simple in the extreme: Just click on “Connect to Server” in the Ubuntu file manager and enter the following server string:

sftp://user@my-url.com:19333/home/martin

The only service that has to be running and accessible over the Internet on the remote side is SSH. In the command above TCP port 19333 is used instead of the default SSH port 22. The file explorer even takes my public/private certificate pair I use for automatic ssh authentication and login so I don’t even have to type a password.

In addition to the file explorer, other programs that use the operating system’s “open file” dialog box such as LibreOffice and gedit can read and write to the remote server as well. How nice! Other programs can still access the remote files via the local file system hook. The file system path looks a bit strange but it really is a valid path:

/run/user/1000/gvfs/sftp:host=my-url.com,port=19333,user=martin

This is one of the things I wished I would have discovered years ago…