SFTP Gateway
What is the SFTP Gateway?
The SFTP Gateway lets you expose any storage over SFTP. From the point of view of your users, Filestash looks like a standard SFTP server that convert the incoming SFTP traffic to anything you have downstream, be it S3, NFS, SMB, FTP, another SFTP server, etc…
We support any kind of storage and authentication system in the market, see the complete list here.
Configuration of the gateway
We will assume you have already followed the configuration guide here. The only things specific to the SFTP gateway is available from /admin/settings under Features:

The only things you need to look after are:
- make sure it is enabled
- link the target to what you have configured under
/admin/storage - add your private key. To generate one:
ssh-keygen -t rsa -f id_rsa_sftp
Working Example
We have configured the storage section with our virtual filesystem:

With this setup you can connect with your favorite SFTP client:
test@127.0.0.1's password:
Connected to 127.0.0.1.
sftp> ls
documents downloads
sftp> documents/foobar/
documents/foobar/bin documents/foobar/boot
documents/foobar/core documents/foobar/dev
documents/foobar/dist documents/foobar/etc
...
sftp>
Note: The gateway do its best to work with all authentication middleware but some of them might need some extra setup on your side. Take OIDC for example, the web app use the clasic grant_type=code that works for all browsers but SFTP client are not browsers and we can’t run any redirect like a browser would, hence you need to ensure your IDP is configured to allow the password grant_type.