GitHub - skorotkiewicz/sfs: Secure File System - A FUSE-based portable filesystem with SSH transport

1 min read Original article ↗

Secure File System — mount and edit files over SSH.

Build

cd sfs
cargo build --release

The binary will be at target/release/sfs.

Platform: Linux/Unix only (uses FUSE)

Usage

Server

Serve a directory over SSH:

./sfs server --auth ~/.ssh/authorized_keys --rwx workspace/

Options:

  • --auth — path to authorized_keys file for client authentication
  • --rwx — enable read, write, and execute permissions
  • --ro — read-only mode
  • --bind — bind address (default: 0.0.0.0:2222)
  • --host-key — path to SSH host key (auto-generated if not specified)

Client

Mount a remote directory locally:

./sfs client pi@dummy:2222 --auth ~/.ssh/id_ed25519 --rwx data_from_server/

Options:

  • user@host[:port] — remote SSH server
  • --auth — path to SSH private key
  • --rwx — enable read, write, and execute permissions
  • --ro — read-only mount

Project Structure

sfs/
├── src/
│   ├── main.rs      # CLI and entry point
│   ├── server.rs    # SSH server implementation
│   ├── client.rs    # SSH client and FUSE filesystem
│   └── protocol.rs  # Request/response protocol
├── Cargo.toml
└── README.md

Dependencies

  • fuser 0.17 — FUSE filesystem
  • russh 0.60 — SSH client/server library
  • tokio 1.51 — Async runtime

License

MIT