How to install SFTPGo on MXLinux

SFTPGo is an open-source and modern sFTP server that allows secure file transfer. It is based on the Go programming language, which makes it fast and easy to use. In this tutorial, we'll learn how to install SFTPGo on MXLinux.

Prerequisites

Step 1: Install Packages

We need to install some packages before installing SFTPGo. Open the terminal and run the following command to update your system's package list.

sudo apt update

Once the update process is finished, we can proceed to install the required packages by running the following command.

sudo apt install sqlite3 openssh-server

Step 2: Download and Install SFTPGo

SFTPGo is a self-contained binary package. We'll be downloading the latest version of SFTPGo from the official GitHub releases page. Run the following commands to download and install SFTPGo:

curl -LJO https://github.com/drakkan/sftpgo/releases/latest/download/sftpgo_linux_amd64.tar.gz
tar -zxvf sftpgo_linux_amd64.tar.gz
sudo mv sftpgo /usr/local/bin/

Step 3: Create a New User

We need to create a new user for SFTPGo to run under. Run the following command to create a new user named "sftpgo":

sudo useradd -r -s /bin/false sftpgo

Step 4: Configure SFTPGo

We need to create a configuration file for SFTPGo to use. Run the following command to create a new configuration file:

sudo nano /etc/sftpgo/conf.json

Paste the following configuration into the file:

{
  "api": {
    "listen_address": "127.0.0.1",
    "port": 8080
  },
  "logs": {
    "file_path": "/var/log/sftpgo.log",
    "max_size_mbytes": 5,
    "max_age_days": 0,
    "max_backups_count": 5,
    "compress": true
  },
  "server": {
    "listen_address": "0.0.0.0",
    "port": 22,
    "host_key_path": "/etc/ssh/ssh_host_rsa_key",
    "auth": {
      "users": [
        {
          "username": "sftpgo",
          "password": "password",
          "home_dir": "/home/sftpgo",
          "permissions": {
            "download": true,
            "upload": true,
            "delete": true,
            "rename": true,
            "create_dirs": true,
            "list": true
          },
          "allowed_ips": [],
          "max_sessions": 0,
          "max_upload_speed": 0,
          "max_download_speed": 0,
          "ip_filter": null
        }
      ],
      "key_pairs": [],
      "session_timeout_seconds": 0,
      "session_timeout_minutes": 0,
      "session_timeout_hours": 0,
      "session_timeout_days": 0
    },
    "max_concurrent_sessions": 0,
    "idle_timeout_seconds": 0,
    "idle_timeout_minutes": 0,
    "idle_timeout_hours": 0,
    "idle_timeout_days": 0,
    "read_buffer_size_bytes": 0,
    "write_buffer_size_bytes": 0,
    "keepalive_seconds": 0,
    "disable_exec": true,
    "disable_terminal": true,
    "disabled_commands": [],
    "debug_level": 0,
    "syslog_enabled": false
  }
}

You can update the username and password as per your choice. Be sure to update the password field with a strong password.

Step 5: Start SFTPGo

Run the following command to start SFTPGo:

sudo sftpgo --config /etc/sftpgo/conf.json

Conclusion

That's it! You have successfully installed and configured the SFTPGo server on your MXLinux system. You should now be able to connect to your SFTP server using a client like Filezilla or WinSCP.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!