Skip to main content

Networking using OpenSSH

The project is to build a Linux Mint machine to have the identical functionality and ergonomics as the existing Windows 10 machine.  This stage relates to networking the Windows 10 machine to the Linux Mint machine.

Environment & required functionality

The network should be a local network - to share files and folders - between the following machines:
  • The Linux Mint Xfce 18.3 laptop "Gandalf";
  • The Windows 10 laptop "Legolas".
The network is a local area network from a domestic router, the usual 192.168.x.x thing.

This is the second attempt to share files and folders between Windows and Linux Mint.

Thankfully, this attempt met the core objectives.

Alternatives

As with the first (failed) attempt, peer-to-peer networking (file sharing, simple two-way server-and-client relationship) is the most efficient way for bulk data transfers, so if the network doesn’t work, then the test has failed.

Software selection

Both machines needed to have new software:
These are not the only available software.  For example, OpenSSH Server is also available from within Windows 10, as an alternative to using PuTTY.  For example, PuTTY has a Unix package, which might have worked on Linux.  These alternatives are outside the scope of this test.

The software selection assumes a client-server relationship between the two machines.  For this test, as with the first (failed) test, Gandalf/Linux Mint is the server and Legolas/Windows is the client.  The main reason for this choice is a presumption of ease.

Installation experience

On Legolas/Windows, PuTTY was the standard Windows experience: download the MSI file, scan it for malware, install it, run it, done.  Although "installed", the applications run more-or-less as stand-alone applications.  The key app for this test was PSFTP, which is a CLI.

On Gandalf/Linux Mint, the GUI app Software Manager was the easiest way to find, to identify and to install openssh-server.  The admin account installed the software; the software ended up as a service run on Gandalf's start-up, which is the desired functionality.

The initial installation and configuration of openssh-server on Gandalf is set out at RootUsers.

Gandalf then needed a hole punched into its firewall (source):

sudo ufw allow ssh

User experience

On Legolas/Windows, both PuTTY and PSFTP successfully connected to Gandalf.

The remote terminal tool PuTTY was able to log into Gandalf's two user accounts, either the admin user or the non-admin user, using their credentials, and was able to use the terminal as if the user were logged onto Gandalf.  This is the correct functionality.

The remote file transfer tool PSFTP was able to log into Gandalf's two user accounts, either the admin user or the non-admin user, using their credentials.  Once logged in, the CLI for PSFTP required the following series of commands.  The last command was all that was necessary to transfer the entire Music folder on Legolas to the Music folder of Gandalf.  Both environments define a user folder "Music", which is convenient!

psftp> open 192.168.0.20
Login in: <remote_username>
Password: <remote_password>
Remote working directory is /home/<remote_username>

psftp> lpwd
Current local directory is C:\Program Files\PuTTY

psftp> lcd c:\users\<local_username>\
New local directory is c:\users\<local_username>

psftp> pwd
Remote directory is now /home/<remote_username>

psftp> put -r Music

Inevitably, a large batch of files is likely to be interrupted, especially when unattended, because that's the way that sod's law works.  A useful command to resume the transfer process is:

psftp> reput -r Music

Although the remote user can log into the server (in this case, Gandalf) remotely (in this case, from Legolas), the same user logging into and outside his account on Gandalf triggered an interruption of PSFTP's transfer of files!  Moral of the story is that once the process is started, leave everything alone until it's done!

As usual, a CLI requires the user to learn commands within productive memory, because there is no on-screen prompting as would typically be available in a GUI.  However, the commands are simple to learn and simple to use, but somewhat tedious: a Windows user would probably dislike having to be so precise in a CLI when all sorts of sloppiness is possible in a GUI designed for users who rightfully need it simple and rightfully expect the machine to get its own (internal) technicalities right.

Dead-ends

The above represents the process that worked.

There was one dead end during the course of discovering the above process, which was to find that the simple firewall ufw was so simple (!) that it blocked the normal use/operation of port 22 (set aside for SSH).

The admin user installed on Gandalf separate app, nmap, to determine whether the port was open, only to find that nmap produced a misleading result.

Conclusion

This test found that two machines can transfer data between their two platform in a peer-to-peer network.

Secure File Transfer Protocol (SFTP) is not the same experience as a Windows user would expect - all CLI, no drag & drop, copying closed files between machines (i.e. no opening files over the network, which is Samba's objective) - but this test proved that the functionality was possible.

This test did not prove a satisfactory and sustainable method for file synchronisation, nor did it consider the security aspects of the functionality, other than the use of SFTP over SSH (which is secure by design).

Next steps

Having established that SFTP over SSH works, there now needs to be a more efficient way for the user to command the machine to synchronise data between machines.  SFTP works efficiently for the initial mirroring of data from source to destination, but isn't efficient at updating already mirrored data.  For this function, a synchronisation tool is necessary.

Completed June 2018.

Comments

Popular posts from this blog

Scanning & OCRring to PDF: Simple Scan, gimagereader and gscan2pdf v NAPS2 for Windows

The project is to build a Linux Mint machine to have the identical functionality and ergonomics as the existing Windows 10 machine. This stage relates to scanning paper documents to PDF and digitising the scanned text via optical character recognition. Environment & required functionality The scan-and-OCR function needs to run on the following machines: The Linux Mint Xfce 18.3 laptop " Gandalf "; A Linux Mint Xfce 18.3 virtual machine " Gimli "; The Windows 10 laptop " Legolas ". In any modern office - whether at home or at work - some transactional documents and documents from public authorities still arrive by snail-mail. This requires the ability to scan all documents, optionally with the digitisation of scanned text (typically via optical character recognition). The hardware is an old HP OfficeJet Pro 276dw, connected to the LAN instead of directly to a workstation. Alternatives There are two strategies: To use the software pr

An attempt at full-disk encryption: Vera Crypt

The project is to build a Linux Mint machine to have the identical functionality and ergonomics as the existing Windows 10 machine. This stage relates to testing full-disk encryption using VeraCrypt . Environment & required functionality Full-disk encryption needs to run on the following machines: The Linux Mint Xfce 18.3 laptop " Gandalf "; The Windows 10 laptop " Legolas ". The objective requirement is to protect user data from the physical theft of the physical machine, to provide an additional line of defence against data loss. This is probably more important for Windows than for Linux Mint.   Even so, in both cases, the operating system is likely to log activity which can reveal personal data and user (meta)data. Full-disk encryption does not mitigate against Microsoft’s sinister telemetry functionality, for which the main solutions seem to be: Either to use tools whose developers are constantly on the prowl, hunting for t

The Big Bang: Microsoft Windows goes for good, positive adaptations required

On 27Mar2021, Linux Mint ate Microsoft Windows 10 on Legolas. Three months on, I conclude beyond any doubt that wiping out Windows was the best decision I ever made. The second best decision I ever made was to test Linux Mint in Virtual Box five years ago. The third best decision I ever made was to take ownership of the learning curve that migrating in Windows really entails. A quick reminder: what’s Microsoft Windows like nowadays? I still need to use Windows at work. I cannot easily describe how painful it now is to use Windows. So I’ll try to describe it difficultly. My work machine is a powerful beast, but it exhibits constant latency. For a keyboard-orientated power user, this means that some keystrokes go walkabouts when other services on the Windows machine go to nuclear war with each other, scrambling to feed their narcissistic self-importance for besieged system resources wholly at the user’s expense. Something on Windows tends to clear the keyboard buffer randomly, resulting