Blogs

Active Managed File Transfer Through Remote SSH Execution

The Managed file transfer (MFT) solution helps organizations to exchange data securely while meeting compliance requirements. Another significant benefit of MFT is to automate data-driven business workflows or processes, which many businesses can rely on to date. The reason is simple: data is exchanged or collected for a purpose and usually triggers a chain of actions. A typical scenario can range from a simple backup of critical data to a complex Electronic Data Exchange (EDI) to automate the fulfilment of an ordering process.

Many MFT solutions are working on a passive model, which serves as a file hub for business partners to push data and take action on received data based on predefined criteria. The solution has to make itself generic to cover as many scenarios as possible, making it inevitably complex and costly. In this article, we introduce a simple technology backed by TurboFTP, i.e. SSH remote execution, to achieve the same goal in some cases but more cost-friendly and with less resource footprint. 

Prerequisites

  1. File transfer is done over SFTP.
  2. The remote SSH Server supports SSH Channel Requests of command execution, for example, the open-source OpenSSH Server and SSH.com's Tectia SSH Server.
  3. You are authorized to execute a shell command on the server.
  4. The triggered processes can be accomplished by executing command-line programs on the remote server. 

Set Up SSH Remote Execution

In TurboFTP client, create a new Scheduled Task in the Task Scheduler. Provide basic info like the remote server address, folder, and launch time. Go to Task Settings -> Advanced, and fill in the remote commands to execute before or after the job.

Suppose we regularly back up a MySQL database called transaction on the remote Linux server.
  • First, we create an SFTP scheduled task with Download as the Synchronization Direction and enter *.gz as inclusion file filters to download the exported database backup copy.
  • Second, we need to fill in the following command in the Before task (R) field to export the MySQL database to a compressed archive.
  • Lastly, we fill in a command line in the After task (R) field to delete the downloaded file. 

cd $HOME/backup; mysqldump --no-tablespaces -udbuser --password='dbpass' transaction > transaction_$(date +"%Y_%m_%d_%I_%M_%p").sql.gz

rm $HOME/backup/*.sql.gz

The above commands assume that you use a bash shell. You can test-drive the task by pressing the 'Run Now' button. If it completes successfully, you will have a compressed backup of the database (e.g. transaction_2022_11_17_08_27_AM.sql.gz) downloaded in the specified local folder.

Unlimited Possibilities

You can do anything as you would on the Linux/Unix command prompt. You can execute a shell script or a script in other languages like Python, Go, etc., with vast libraries or extensions for your need. For example, you can send Emails, delete or move local files, and upload files to cloud storage like Amazon S3 (with just a few lines of code). 

Conclusion

Since many organisations have adopted SSH protocol to exchange data securely, it is becoming a significant standard for secure file transfer. SFTP over SSH provides the security that helps meet compliance standards like HIPPA, PCI DSS, etc. Turbo FTP client offers a cost-efficient approach to implement managed file transfer with its support of SSH remote execution. 

×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

MFT Server IP Blocking Or Whitelisting Based On Or...
FTPS And SFTP - Which Is More Secure?

Related Posts