2025-09-20 10:58:02 +02:00
|
|
|
|
# BackTunnel – Secure Reverse SSH Folder Sharing Toolkit
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
**BackTunnel** lets you share and mount folders between Linux machines behind NAT or firewalls using just two friendly commands.
|
|
|
|
|
|
No central servers. No cloud uploads. Temporary, peer-to-peer, SSH-based.
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
---
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
## ⚡ Quick Start (3 steps)
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
1. **On the sharing machine (server):**
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
|
|
|
|
|
backtunnel-share ~/Documents with user@remotehost for 2h -i
|
|
|
|
|
|
```
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
→ Opens a tunnel for 2 hours and prints an **invite**.
|
2025-09-14 12:54:06 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
2. **Send the invite** (via chat, email, QR). It looks like:
|
2025-09-14 12:54:06 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
|
|
|
|
|
backtunnel-auth-setup -p 2222 user@localhost
|
|
|
|
|
|
backtunnel-access '/home/alice/Documents' from user@remotehost -p 2222 -m "$HOME/remote-rssh"
|
|
|
|
|
|
```
|
2025-09-14 12:54:06 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
3. **On the accessing machine (client):**
|
2025-09-14 12:54:06 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
|
|
|
|
|
mkdir -p ~/remote-rssh
|
|
|
|
|
|
backtunnel-auth-setup -p 2222 user@localhost
|
|
|
|
|
|
backtunnel-access '/home/alice/Documents' from user@remotehost -p 2222 -m ~/remote-rssh
|
|
|
|
|
|
```
|
2025-09-14 12:54:06 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
→ Folder is mounted at `~/remote-rssh`.
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
Unmount afterwards with:
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2025-09-20 10:58:02 +02:00
|
|
|
|
fusermount -u ~/remote-rssh
|
2025-09-14 11:29:21 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-14 12:54:06 +02:00
|
|
|
|
---
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
## 🚀 Why BackTunnel?
|
2025-09-14 19:44:37 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
* **Works behind NAT/firewalls**: reverse SSH tunnels, no port forwarding needed.
|
|
|
|
|
|
* **Private by design**: no third-party relays or cloud.
|
|
|
|
|
|
* **Temporary by default**: shares auto-stop after chosen duration.
|
|
|
|
|
|
* **Simple invites**: send one-liners (or QR codes) to colleagues.
|
|
|
|
|
|
* **Safe**: restricted SFTP-only keys ensure no shell access.
|
|
|
|
|
|
* **Desktop integration**: right-click folders in Dolphin to share or access.
|
2025-09-14 19:44:37 +02:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
## ✨ Commands
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
### `backtunnel-share` — start a share
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
*(sharing side)*
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2025-09-20 10:58:02 +02:00
|
|
|
|
backtunnel-share /path/to/folder with user@remotehost for <duration> [options]
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
**Duration formats:** `30m`, `2h`, `1d`
|
|
|
|
|
|
**Key options:**
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
* `-p, --tunnel-port <PORT>` — Remote port (default: `2222`)
|
|
|
|
|
|
* `-l, --local-ssh-port <PORT>` — Local SSHD port (default: `22`)
|
|
|
|
|
|
* `-i, --invite` — Print a ready-to-copy **invite**
|
|
|
|
|
|
* `--invite-mount <PATH>` — Suggested mount point (default: `~/remote-rssh`)
|
|
|
|
|
|
* `--qr` — Show invite as QR code
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
---
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
### `backtunnel-access` — mount a share
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
*(accessing side)*
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
|
|
|
|
|
backtunnel-access /path/to/folder from user@remotehost [options]
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
**Options:**
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
* `-p, --port <PORT>` — Remote tunnel port (default: `2222`)
|
|
|
|
|
|
* `-m, --mount-point <PATH>` — Local mount point (default: `~/remote-rssh`)
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
Unmount with:
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2025-09-20 10:58:02 +02:00
|
|
|
|
fusermount -u ~/remote-rssh
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 📁 Profiles
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
Simplify frequent shares with `~/.config/backtunnel/profiles.ini`.
|
|
|
|
|
|
Example:
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```ini
|
|
|
|
|
|
[default]
|
|
|
|
|
|
tunnel_port=4422
|
|
|
|
|
|
invite_mount=$HOME/shared
|
|
|
|
|
|
|
|
|
|
|
|
[work]
|
|
|
|
|
|
user=alice
|
|
|
|
|
|
host=vps.example.com
|
|
|
|
|
|
tunnel_port=4423
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
Use with:
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2025-09-20 10:58:02 +02:00
|
|
|
|
backtunnel-share ~/reports with @work for 6h -i
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
---
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
## 🔒 Security
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
* **Restricted keys**: usable only through the tunnel (127.0.0.1).
|
|
|
|
|
|
* **SFTP-only**: enforced with `internal-sftp,restrict`.
|
|
|
|
|
|
* **Temporary**: ends when the tunnel closes.
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
## 🖥️ Dolphin Integration
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
After install, Dolphin menus appear:
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
* **Share via BackTunnel…** — GUI wizard for remote, duration, ports, invite.
|
|
|
|
|
|
* **Access via BackTunnel…** — GUI wizard for remote, port, mount point.
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
Logs:
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```
|
|
|
|
|
|
~/.local/state/backtunnel/servicemenu.*.log
|
|
|
|
|
|
```
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
## 📦 Install
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
|
|
|
|
|
sudo bash scripts/install.sh
|
|
|
|
|
|
make init # copy example profiles.ini
|
|
|
|
|
|
```
|
2025-09-19 15:30:41 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
Uninstall:
|
2025-09-19 15:30:41 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
|
|
|
|
|
sudo bash scripts/uninstall.sh
|
|
|
|
|
|
```
|
2025-09-19 15:30:41 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
Arch Linux:
|
2025-09-19 15:30:41 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
|
|
|
|
|
makepkg -si
|
|
|
|
|
|
```
|
2025-09-14 14:34:46 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
---
|
2025-09-14 14:34:46 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
## 📖 Man Page
|
2025-09-14 14:34:46 +02:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2025-09-20 10:58:02 +02:00
|
|
|
|
man backtunnel
|
2025-09-14 14:34:46 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-14 12:54:06 +02:00
|
|
|
|
---
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
## 🧾 License
|
|
|
|
|
|
|
|
|
|
|
|
Licensed under **GNU GPL v3.0**
|
|
|
|
|
|
© 2025 LUXIM d.o.o., Slovenia – Matjaž Mozetič
|
2025-09-14 12:54:06 +02:00
|
|
|
|
|
|
|
|
|
|
---
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
## 📝 Cheat Sheet (TL;DR)
|
|
|
|
|
|
|
|
|
|
|
|
**Start a share:**
|
|
|
|
|
|
|
2025-09-14 11:29:21 +02:00
|
|
|
|
```bash
|
2025-09-20 10:58:02 +02:00
|
|
|
|
backtunnel-share ~/Documents with user@remotehost for 2h -i
|
2025-09-14 11:29:21 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
**Send this invite to your colleague:**
|
2025-09-14 12:54:06 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
|
|
|
|
|
backtunnel-auth-setup -p 2222 user@localhost
|
|
|
|
|
|
backtunnel-access '/home/user/Documents' from user@remotehost -p 2222 -m ~/remote-rssh
|
|
|
|
|
|
```
|
2025-09-14 14:34:46 +02:00
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
**On the client:**
|
2025-09-14 14:34:46 +02:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2025-09-20 10:58:02 +02:00
|
|
|
|
mkdir -p ~/remote-rssh
|
|
|
|
|
|
backtunnel-auth-setup -p 2222 user@localhost
|
|
|
|
|
|
backtunnel-access '/home/user/Documents' from user@remotehost -p 2222 -m ~/remote-rssh
|
2025-09-14 14:34:46 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-20 10:58:02 +02:00
|
|
|
|
**Unmount:**
|
|
|
|
|
|
|
2025-09-14 11:29:21 +02:00
|
|
|
|
```bash
|
2025-09-20 10:58:02 +02:00
|
|
|
|
fusermount -u ~/remote-rssh
|
2025-09-14 11:29:21 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-14 12:54:06 +02:00
|
|
|
|
---
|