FTP/FTPS Support

Stylus SFTP Server includes an FTP/FTPS listener alongside the primary SFTP listener. Built on Apache FtpServer 1.2.0, it supports both implicit and explicit TLS modes. FTP users share the same user accounts, home directories, disk quotas, and audit trail as SFTP — no separate configuration is required.

Enabling FTP

The FTP listener is disabled by default. To enable it, uncomment (or add) the FTP listener block in sftp-server.xml:

<listener type="ftp">
    <enabled>true</enabled>
    <port>21</port>
    <idle-timeout-seconds>600</idle-timeout-seconds>
    <passive-ports-start>50000</passive-ports-start>
    <passive-ports-end>50100</passive-ports-end>
</listener>

Once enabled, the FTP listener starts on the configured port and accepts connections using the same authentication providers as SFTP (LDAP, JDBC, XML, or public key).

Virtual folders on FTP FTP sessions can surface virtual folders alongside the user's home directory by enabling <ftp-mount-routing enabled="true"/> in sftp-server.xml. The flag hot-reloads and is independent of the corresponding SFTP switch, so an operator can expose the same folder ACLs to just one protocol if that's easier for their clients. See the Organizations & Groups chapter for the folder / ACL model itself.

TLS Modes

Stylus SFTP Server supports three FTP connection modes:

Explicit TLS (STARTTLS) — Recommended

The client connects on the standard FTP port (typically 21) and issues an AUTH TLS command to upgrade the connection to TLS. This is the most widely supported mode and is recommended for most deployments.

Add <explicit-ssl>true</explicit-ssl> and the keystore settings inside the <listener type="ftp"> block in conf/sftp-server.xml:

<!-- in conf/sftp-server.xml -->
<listeners>
    <listener type="ftp">
        <enabled>true</enabled>
        <port>21</port>
        <explicit-ssl>true</explicit-ssl>
        <keystore-path>${STYLUS_SFTPSERVER_DATA}/conf/ftpserver.p12</keystore-path>
        <keystore-password>yourpassword</keystore-password>
        <ssl-protocols>TLSv1.2,TLSv1.3</ssl-protocols>
    </listener>
</listeners>

Implicit TLS

The client connects directly over TLS on a dedicated port (typically 990). There is no plaintext phase — TLS is established immediately.

Use <implicit-ssl>true</implicit-ssl> instead of <explicit-ssl> in the same location:

<!-- in conf/sftp-server.xml -->
<listeners>
    <listener type="ftp">
        <enabled>true</enabled>
        <port>990</port>
        <implicit-ssl>true</implicit-ssl>
        <keystore-path>${STYLUS_SFTPSERVER_DATA}/conf/ftpserver.p12</keystore-path>
        <keystore-password>yourpassword</keystore-password>
        <ssl-protocols>TLSv1.2,TLSv1.3</ssl-protocols>
    </listener>
</listeners>

Plain FTP (No TLS)

If neither <explicit-ssl> nor <implicit-ssl> is set in the <listener type="ftp"> block, the listener accepts unencrypted FTP connections. No keystore configuration is needed.

Warning Plain FTP transmits credentials and data in cleartext. It is not recommended for production use. Always enable one of the TLS modes when operating outside a trusted network.

Keystore Configuration

When TLS is enabled (explicit or implicit), a Java keystore containing the server certificate and private key is required. Configure it in the FTP listener block:

<keystore-path>${STYLUS_SFTPSERVER_DATA}/conf/ftpserver.p12</keystore-path>
<keystore-password>changeit</keystore-password>
<ssl-protocols>TLSv1.2,TLSv1.3</ssl-protocols>
<enabled-cipher-suites></enabled-cipher-suites>  <!-- empty = JVM defaults -->
<key-alias></key-alias>                           <!-- empty = first entry -->
<key-password></key-password>                     <!-- empty = keystore password -->
Setting Description Default
keystore-path Path to the PKCS12 or JKS keystore file. Supports ${STYLUS_SFTPSERVER_DATA} macro.
keystore-password Password for the keystore file.
ssl-protocols Comma-separated list of allowed TLS protocol versions. TLSv1.2,TLSv1.3
enabled-cipher-suites Comma-separated cipher suite names. Empty uses JVM defaults. JVM defaults
key-alias Alias of the certificate entry in the keystore. Empty selects the first entry. First entry
key-password Password for the private key entry. Empty uses the keystore password. Keystore password

Certificate Management

All three administration tools — CLI, Swing GUI, and web console — provide certificate management operations for the FTPS keystore:

Operation CLI Command Description
List certificates list-certs Show all certificates in the keystore
Import PEM import-pem <alias> <cert> <key> Import a PEM-encoded certificate and private key
Import P12 import-p12 <file> <password> Import an existing PKCS12 keystore
Self-signed generate-cert <alias> <cn> Generate a self-signed certificate

The Swing admin provides a dedicated Certificates tab with the same operations in a graphical interface. The web console exposes equivalent REST endpoints.

Tip For production deployments, obtain a certificate from a trusted Certificate Authority (CA) and import it using import-pem or import-p12. Self-signed certificates will trigger warnings in most FTP clients.

Installing a Production SSL Certificate

The installer generates a self-signed certificate for initial setup. For production use, you should replace it with a certificate from a trusted Certificate Authority (CA) such as DigiCert, Let's Encrypt, or your organization's internal CA. This eliminates security warnings in FTP clients and ensures the server's identity is verified.

Step 1 — Generate a Certificate Signing Request (CSR)

If your CA requires a CSR, generate one using keytool from the server's bundled JRE. Use the hostname that clients will connect to as the Common Name (CN):

# Generate a new keypair and CSR
keytool -genkeypair -alias ftpserver -keyalg RSA -keysize 2048 \
    -dname "CN=sftp.yourcompany.com,O=Your Company,C=US" \
    -keystore conf/ftpserver.p12 -storetype PKCS12 -storepass yourpassword

# Export the CSR to send to your CA
keytool -certreq -alias ftpserver \
    -keystore conf/ftpserver.p12 -storetype PKCS12 -storepass yourpassword \
    -file server.csr

Send server.csr to your CA. They will return a signed certificate (usually as .pem, .crt, or .cer files).

Step 2 — Import the Signed Certificate

Once you receive the signed certificate from your CA, import it using one of these methods:

Option A — Import PEM files (certificate + private key)

If your CA provided separate PEM files for the certificate and private key:

Admin ToolHow
CLI
admin import-pem --cert server.pem --key server-key.pem
Web Admin Certificates tab → Import PEM → paste certificate and key content
Swing Certificates tab → Import PEM button → select files

Option B — Import a PKCS12 (.p12 / .pfx) file

If your CA or IT department provided a .p12 or .pfx file containing the certificate and private key:

Admin ToolHow
CLI
admin import-p12 --source signed-cert.p12 --source-password capassword
Web Admin Certificates tab → Import P12 → upload file and enter password
Swing Certificates tab → Import P12 button → select file

Option C — Use Let's Encrypt (free, automated)

Let's Encrypt provides free certificates. After obtaining the certificate with certbot or a similar tool, import the PEM files:

# Typical Let's Encrypt file locations (Linux)
admin import-pem --cert /etc/letsencrypt/live/sftp.yourcompany.com/fullchain.pem \
                 --key  /etc/letsencrypt/live/sftp.yourcompany.com/privkey.pem

Let's Encrypt certificates expire every 90 days. Set up a cron job or scheduled task to re-import after renewal. The server's admin alert system will email administrators when the certificate is within 30 days of expiry.

Step 3 — Verify the Certificate

After importing, verify the certificate is installed correctly:

Admin ToolHow
CLI
admin list-certs
Shows alias, subject, issuer, expiry date, and key type.
Web / Swing Certificates tab → view the certificate list

Step 4 — Restart the FTPS Listener

The FTPS listener loads the keystore at startup. After importing a new certificate, restart the server for the change to take effect:

admin stop-server
admin start-server

Or restart the Windows service from the Services console.

Important: Hostname Matching The certificate's Common Name (CN) or Subject Alternative Name (SAN) must match the hostname that clients use to connect. For example, if clients connect to sftp.yourcompany.com, the certificate must be issued for that hostname. A mismatch will cause FTP clients to reject the connection or show a security warning.
Certificate Expiry Monitoring When admin alerts are enabled, the server automatically checks certificate expiry every hour and emails administrators when a certificate is within 30 days of expiring. Alert frequency increases as the expiry date approaches.

Installer FTPS Setup

The installer can configure FTPS during the initial installation, eliminating the need to edit configuration files manually.

GUI Installer

The SSL configuration panel provides:

CLI Installer

Use command-line flags to configure FTPS non-interactively:

--ftpssl explicit|implicit --ftpkeystorepath /path/to/keystore.p12 --ftpkeystorepassword pass

If no keystore is provided, the installer automatically generates a self-signed certificate for immediate use.

Passive Port Range

FTP uses separate connections for data transfer. In passive mode (required for NAT and firewall traversal), the server opens a listening port from a configured range and the client connects to it.

<passive-ports-start>50000</passive-ports-start>
<passive-ports-end>50100</passive-ports-end>

You must open these ports in your firewall alongside the FTP control port. The range should be large enough to accommodate the expected number of concurrent data transfers.

Note Each active data transfer (file upload, download, or directory listing) consumes one passive port. A range of 100 ports (50000–50100) supports up to 100 concurrent data connections.

Known Limitations

The following TLS-related features are not currently supported in the FTPS listener:

Feature Status
Mutual TLS (client certificate authentication) Not supported
CRL / OCSP certificate revocation checking Not supported
ACME / Let's Encrypt auto-renewal Not supported
SNI (Server Name Indication) Blocked by Apache FtpServer 1.2.0
Hot-reload of SSL configuration Not supported — server restart required for certificate changes