Skip to content
LukeHarrison1990Public

About

A portable FTP, FTPS and SFTP server for Windows

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Ferry logo

Ferry

A tiny portable FTP, FTPS and SFTP server for Windows.
One exe, no installer. Pick a folder, press Start.

Ferry running with three connected clients


Ferry is for the times you just need a file server now: flashing firmware onto a network device, pulling photos off a camera, moving a big file between two PCs, or giving a colleague somewhere to drop files. It runs straight from the exe, remembers your settings, and gets out of the way.

Features

  • FTP, FTPS and SFTP in one app, each on its own port, all at once or separately.
  • Portable: a single Ferry.exe, nothing to install, settings kept in a folder beside it.
  • Anonymous logins: the username anonymous (or ftp) with any password, or none at all for SFTP. Exactly what routers, access points, printers and cameras expect.
  • A user account with a username and password, alongside or instead of anonymous access. The password is stored as a salted PBKDF2-SHA256 hash, never as plain text.
  • Choose the network adapter: listen on one adapter (say, the cable to a device on your bench) or on all of them.
  • Permissions: download, upload, delete/rename/overwrite and create folders, each on or off, plus a "read-only for anonymous users" switch.
  • FTPS that just works: a self-signed certificate valid for 20 years is created the first time, so it won't expire on you next year. Make TLS optional or required.
  • SFTP host key created once and kept, so clients don't warn you every time. Its fingerprint is shown in the window so you can check it.
  • Passive and active FTP, a configurable passive port range, an optional public address for passive mode (for use through a router), and resumable transfers.
  • See what's happening: who's connected, from where, what they've transferred, and a filterable activity log you can copy or save to a file.
  • Plain-English errors: "port 21 is already in use by another program" rather than os error 10048.
  • Safe by design: users can't leave the shared folder (.., drive letters and links that point elsewhere are refused), there's no shell or command execution over SSH, and repeated failed logins are slowed down.
  • ferry-cli.exe runs the same server without a window, for scripts or servers.

Download and run

  1. Download Ferry.exe from the Releases page.
  2. Put it anywhere you like (Desktop, a USB stick, a tools folder) and double-click it.
  3. Choose the folder to share and press Start server.

The first time you start it, Windows Firewall may ask whether Ferry can use the network. Allow it on the networks you want to share with (usually Private).

Because Ferry isn't code-signed, Windows SmartScreen may say it "protected your PC" the first time. Click More info, then Run anyway. If you'd rather not, build it yourself (see below) in a few minutes.

Requirements: 64-bit Windows 10 or 11.

Using it

Setting What it does
Shared folder The folder people see when they connect. They can't go above it.
Network adapter All network adapters, or one adapter's address. Press 🔄 after plugging in a cable or joining a network.
FTP / port Plain FTP, normally port 21.
FTPS Off, Allowed (clients may upgrade with AUTH TLS) or Required (every client must use TLS). Most network devices only speak plain FTP, so keep it on Allowed unless you need it.
SFTP / port FTP's secure cousin, over SSH. Default 2222, so it won't clash with an SSH server on 22.
Allow anonymous logins Username anonymous or ftp, any password.
User account A username and password. Usernames aren't case-sensitive.
Permissions Apply to everyone. Uploading over an existing file counts as overwrite.
Advanced Passive port range and address, idle timeout, active mode, failed-login protection, start automatically, and saving the log to a file.

The How to connect box shows the exact addresses to type into a client, with copy buttons, plus the SFTP key and FTPS certificate fingerprints.

Example: flashing a Ruckus access point

Share the folder holding the firmware, turn on Allow anonymous logins, set FTPS to Allowed or Off, and choose the adapter connected to the AP. Then, on the AP's CLI:

rkscli: fw set proto ftp
rkscli: fw set host 192.168.0.10
rkscli: fw set port 21
rkscli: fw set user anonymous
rkscli: fw set password anything
rkscli: fw set control R510_xxx.rcks
rkscli: fw update

Use the address Ferry shows under How to connect. You'll see the AP log in and download the image in Ferry's activity log.

Through a router (from the internet)

FTP needs more than one port. Forward the FTP port and the passive port range (50000-50100 by default) to the PC running Ferry, and put your public IP address in Advanced → Passive address. SFTP only needs its one port forwarded. Prefer SFTP or FTPS over plain FTP across the internet, since plain FTP sends passwords unencrypted.

Where Ferry keeps things

Everything lives in a Ferry-data folder next to Ferry.exe:

File Contents
settings.json Your settings (the password only as a hash).
ftps-certificate.pem, ftps-private-key.pem The FTPS certificate. Delete them, or use New FTPS certificate, to make a new one.
sftp-host-key-ed25519 The SFTP host key. Keep it private.
logs\ Daily log files, if you turned that on.

If Ferry can't write beside the exe (for example in Program Files), it uses %APPDATA%\Ferry instead. Set the FERRY_DATA_DIR environment variable to choose another place.

ferry-cli

ferry-cli.exe runs the same server in a console. With no options it uses the settings saved by the window; options override them for that run.

ferry-cli --root D:\Firmware --ip 192.168.0.10 --anonymous --no-sftp
ferry-cli --root C:\Share --no-anonymous --user luke --password s3cret --ftps required
ferry-cli --list-adapters
ferry-cli --help

Building from source

You need Rust (stable).

On Windows:

git clone https://github.com/LukeHarrison1990/ferry
cd ferry
cargo build --release

The exes are in target\release\ (ferry.exe and ferry-cli.exe).

On Linux, cross-compiling for Windows: install MinGW (sudo apt install gcc-mingw-w64-x86-64) and the Windows target (rustup target add x86_64-pc-windows-gnu), then run scripts/build-windows-from-linux.sh. The exes land in dist/.

Tests

cargo test --lib                     # unit tests
cargo build --bin ferry-cli
pip install paramiko                 # plus lftp and openssh-client from your package manager
python3 tests/integration_test.py    # 28 end-to-end checks with real FTP, FTPS and SFTP clients

The end-to-end tests start ferry-cli with different settings and exercise it with Python's ftplib, Paramiko, OpenSSH's sftp, curl and lftp: logins, permissions, FTPS, active and passive mode, resume, escaping the shared folder, busy ports and more. GitHub Actions runs them on every push and builds the Windows exes.

How it's built

Part Built with
Window egui / eframe (GPU-drawn, immediate-mode GUI)
FTP and FTPS libunftp with rustls
SFTP russh and russh-sftp
Certificates and hashing rcgen, ring
Async runtime Tokio
src/
  main.rs      the window's entry point
  ui.rs        the window
  cli.rs       ferry-cli
  lib.rs       the server engine, shared by both:
  engine.rs      starts and stops everything together
  ftp.rs         FTP/FTPS: logins, permissions, activity
  sftp.rs        SFTP: SSH layer and file operations
  access.rs      login rules, permissions, keeping users inside the shared folder
  config.rs      settings, where they're stored, password hashing
  keys.rs        FTPS certificate and SFTP host key
  netif.rs       network adapters
  state.rs       activity log and connected sessions
vendor/libunftp  libunftp 0.25.1 with two small fixes (see FERRY-PATCHES.md)
tests/           end-to-end tests

vendor/libunftp carries two fixes to libunftp's FTPS data connections: a failed TLS handshake no longer panics, and uploads end with a proper TLS shutdown. Both are described in vendor/libunftp/FERRY-PATCHES.md and would be worth sending upstream.

Licence

Ferry is released under the MIT licence. The vendored copy of libunftp is Apache-2.0 (see vendor/libunftp/LICENSE). Other libraries are pulled in by Cargo under their own licences, mostly MIT and/or Apache-2.0; run cargo about for a full list.

About

A portable FTP, FTPS and SFTP server for Windows

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages