Using SSH in KDE's Dolphin File Browser

July 13, 2019, 9 p.m.

KDE's Dolphin file browser is widely regarded as the most customizable. But it also has a lot of advanced built-in functionality and is extensible to add even more capability. Among its most useful functionality is the ability to access and manage remote files directly in the file browser using the FISH protocol, which in turn relies on the SSH protocol. This article describes how this can be used to transfer files to and from remote computers and to even access and edit remote files locally.

Introduction

The functionality discussed here relies on the FISH network protocol to provide the underlying capability by in turn using the SSH protocol. So, in order to use it, the remote computer must have an SSH server enabled and configured to authenticate a user account on that machine using a public/private key pair as the first attempted authentication method.

KDE Plasma Desktop's File Browser, Dolphin
Dolphin is a highly customizable and feature rich file browser with remote browsing capabilities. In this screenshot Dolphin is shown with two panes active, both displaying /home/brook from the local computer.

Connecting to the Remote Computer

The connection to the remote computer is initiated by entering

fish://username@hostname or fish://username@IPaddress
in the path entry box of Dolphin. Once connected, the files and folders on the remote computer can be manipulated as if they are on the local computer with the same rights as the user of the remote computer whose credentials were used to establish the SSH connection. In the following set of slides, a connection is established in the right pane to a virtual machine at 192.168.56.101. The Dolphin right pane path entry box is cleared in Slide 1 and in Slide 2 fish://username@192.168.56.101 is entered in the path entry box. Slide 3 shows Dolphin displaying the user's home folder on the remote computer. Slide 4 presents the output of ls on the remote computer through an SSH connection in the Konsole terminal that shows the same contents as in Dolphin.
  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
Connecting to a Remote Computer in Dolphin
Connecting is simply a matter of entering a URL in the form of fish://username@host in Dolphin's path entry field.

Transferring Files to the Remote Computer

Files and folders can be dragged and dropped from the local computer to the remote computer and vice versa. Files can even be transferred between two remote computers connected Dolphin using FISH. The following set of slides show the process of copying /home/brook/liquidprompt/ to /home/username/ on the remote computer at 192.168.56.101 after connecting to it in Dolphin as username.

  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
Transferring Files to the Remote Computer
The directory is selected in the pane displaying the local files and dragged to the pane displaying the remote files; dropping it in the right pane displays the context menu with options including Copy Here and Move Here (Slide 1).

The process of transferring files using Dolphin and FISH is well integrated into the overall Plasma desktop environment. Slide 2 in the above set shows the notification at the completion of the transfer.

An Expanded Notification Showing File Transfer Progress
Dolphin and the FISH protocol are well integrated into the overall Plasma desktop environment.
The screenshot above and Slide 3 in the previous set of slides show an expanded notification indicating the progress of the file transfer.

Accessing and Editing Files on the Remote Computer

The remote files displayed locally can be opened as if they are stored on the local computer. In the first slide below, the remote user's .bashrc file is being opened locally using the right click context menu in order to choose the program to use to open the file. The second slide shows the remote .bashrc file open in the Kate text editor. Note that because the option to display the full file path in the titlebar is set in Kate, the full path of the file is shown as:

fish://username@192.168.56.101/home/username/.bashrc
and we can see that the file being edited is a remote file at /home/username/.bashrc on the host at 192.168.56.101 accessed through the FISH protocol as the remote computer user username.
  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
  • GNOME Software on Clear Linux 28210
Accessing and Editing Remote Files Locally
The remote files can be opened and modified locally as if they are stored on the local machine. When saving the modified file is saved to the remote machine.
The third slide above shows new text -- lines activating liquidprompt -- added to the end of the remote .bashrc file by copying the same text from the local computer user's .bashrc. Note the asterisk in the Kate window's titlebar indicating the file has unsaved changes. After saving the file (fourth slide above) the asterisk is indicating unsaved changes is gone. At this point the edited file is saved back to original location on the remote computer. In the fifth slide, note the modified time is also updated on the remote computer in Dolphin and also on the separate SSH connection in Konsole.

Conclusion

The FISH protocol in Dolphin allows Plasma users to easily transfer files between local and remote computers, streamlining workflows that might otherwise require using other programs such as Filezilla or scp, by allowing operations directly in Dolphin. It also allows access to remote files for direct editing on the local computer. All that is required is a configured SSH server on the remote computer.