Direct File-Sharing in Linux using SFTP

If you have files on one Linux PC that you’d like to transfer to another, and using a removable flash drive would be tedious, time-consuming or inconvenient in some other way, then using SFTP by way of running an SSH server on one of the PCs will do the trick and might be the most convenient and/or quickest way to do it.

This is assuming that you don’t have a way to connect between the PC’s by some sort of shares via the graphical file managers. If so, then disregard. Otherwise, read on.

Note: This tutorial is aimed toward systems using the APT package manager (Debian, Ubuntu, Linux Mint, etc.), and so you’ll have to make some changes to the commands that search for/install packages through terminal and that start/stop services, as needed.

In order to follow the tutorial, you’ll need to install the following software:

  • FileZilla on one PC
  • OpenSSH-Server on the other PC

In most cases, both of these applications are available as binary packages from the default repositories that your PC is already configured to use. It doesn’t matter which system you install which application, but the one that gets FileZilla will be the one you directly use to control the transfer of files, so it is best to use the PC you’re actually planning to be on for that.

Note: Using SFTP, only the /home/$user directory on the machine running the SSH server will be available to transfer from/to using the SFTP client.