https://www.drupal.org/project/flysystem_sftp
Provides an SFTP plugin for Flysystem. Useful when setting up a custom Media type that can be stored on a remote system. (Remote Linux).
This is a quick proof of concept showing how Drupal Media files can be configured to use a remote file system. Flysystem SFTP can provide a mechanism for low-budget Content Delivery Network (CDN) for Drupal media. This is a helpful tool if you need to proxy Intranet media through Rich Text HTML email.


The connection string for the remote file service is kep in Drupal's site settings.php file.

# sites/default/settings.php
$schemes = [
'cdnsftp' => [
'driver' => 'sftp',
'config' => [
'host' => '',
'username' => '',
'password' => '',
'port' => 22,
'root' => '/images/',
],
'public' => TRUE,
],
];
$settings['flysystem'] = $schemes;
Requires:
- Flysystem
- File
- Field
- Image