Remote "Networked" Editing

At the April 16th meeting (2014) of the Framingham Makerspace RPi group, the group leader told us that he uses a text editor with a built-in secure ftp (sftp) capability so he can use his main computer to do the editing with his favorite editor and then automatically transfer the finished file back to the "remote" RPi, even if it is just across the table. That lets him run the RPi in "headless" mode (without a monitor, keyboard and mouse connected). Headless setups are convenient when the RPi is part of a project that does steady sensor or controller work, sort of "embedded" computing instead of having the RPi as a desktop substitute. The alternative, using the built-in vi(m) editor on the RPi through a SSH connection, is good enough, in his opinion, in a pinch. For daily development work, he likes his comfortable text editor and it may not be available on the RPi.

Now, I am not going to use his recommended Notepad++ because that is a Windows program, and I don't use a Macintosh which he mentioned, so I decided to check into the possibilities for the Kate text editor from the KDE community that runs on my Kubuntu laptop.

Step one is to open Dolphin and choose Network from the Places menu and Add new Network Folder.

Dolphin Network Connection

Step two is to select the SSH Secure Shell connection.

Dolphin Network Connection

The third step is to fill in the appropriate information for the connection you want to make. (A secure shell server must be running on the RPi for this to work. The SSH server is typically installed by default. I knew the IP address of the RPi by using Nmap which is covered in another RPi note.

Dolphin Network Connection

I was asked to provide a password to the RPi in a popup window. You didn't think I was going to reveal that password here, did you? (It only shows as dots in the password blank, so you would not have seen it anyway.

Dolphin Network Connection

I created a short test program using Kate which is running on my laptop, saved it and switched to a secure shell connection to run the test program with the python test.py command line entry. There, before everyone looking over my shoulder, is the result.

test program run at ssh

From there on, just choose the icon from the list of network connection icons and provide the user password to make a connection to the folder you chose. Just open the file you want in Kate, edit and save. The saved file will be available to use on the RPi.

The Ubuntu Unity Experience

I run Ubuntu in a virtual machine on my laptop when I need it for testing. Ubuntu is the main Linux version supplied by Canonical, though they also support Kubuntu/KDE and other desktop tools to a lesser extent. Ubuntu users will need to take similar steps. Click the Ubuntu button at the top of the Dash and enter sftp://192.168.1.166:22. Using the Ubuntu file manager, you must enter the type of connection, the IP address of the RPi and the port all as a single piece where they were separate GUI steps in Kubuntu. One needs to expect to puzzle out differences when moving from one set of tools to another.

Ubuntu sftp

You will see the expected warning about not recognizing the certificate. (I did not see that warning within my own Kubuntu install because I had made a previous secure shell connection via the command line. A virtual computer running inside Kubuntu does not know about the Kubuntu connections, so I saw the certificate warning you should see the first time you make a connection to the RPi.)

Ubuntu sftp

Ubuntu sftp

Ubuntu sftp

Once the connection was there, the file browser displayed my RPi files, and I was able to use the gedit text editor program to modify the test file and then rerun the program via a secure shell command line connection. No matter which tools you use, you will actually need to have two connections to the RPi. One is for the GUI editor. The other is a command line SSH connection to launch programs.

References:

Remote sftp with UltraEdit on a Gnome system