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 17:17:26 +02:00
|
|
|
|
**BackTunnel** is a lightweight toolkit to share and mount folders between Linux machines behind NAT or firewalls using **reverse SSH tunnels**.
|
|
|
|
|
|
No third-party relay, no cloud dependency – just peer-to-peer, temporary, SSH-based access.
|
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 17:17:26 +02:00
|
|
|
|
## ⚡ Quick Start
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
### 1. Accessor: Prepare your key (one-time)
|
|
|
|
|
|
```bash
|
|
|
|
|
|
backtunnel-keys print
|
|
|
|
|
|
```
|
|
|
|
|
|
Send the printed public key to the sharer.
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
### 2. Sharer: Start sharing and authorize the accessor
|
|
|
|
|
|
```bash
|
|
|
|
|
|
backtunnel-share ~/Documents with alice@remotehost for 2h -i --allow-key ./alice.pub
|
|
|
|
|
|
```
|
|
|
|
|
|
This injects a **temporary, restricted SFTP-only key** and prints an invite.
|
2025-09-14 11:29:21 +02:00
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
### 3. Accessor: Mount the shared folder
|
|
|
|
|
|
```bash
|
|
|
|
|
|
backtunnel-access '/home/sharer/Documents' from alice@remotehost -p 2222 -m ~/remote-rssh
|
|
|
|
|
|
```
|
|
|
|
|
|
Unmount 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 17:17:26 +02:00
|
|
|
|
## ✨ Features
|
2025-09-14 19:44:37 +02:00
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
- **NAT/firewall friendly**: works without port forwarding.
|
|
|
|
|
|
- **Temporary by design**: shares auto-expire after a set duration.
|
|
|
|
|
|
- **Invite workflow**: sharer sends a one-liner or QR code to accessor.
|
|
|
|
|
|
- **Restricted keys**: accessor keys are usable *only* for SFTP via the tunnel and are auto-removed when the share ends.
|
|
|
|
|
|
- **Profiles**: save defaults and common remotes in `profiles.ini`.
|
|
|
|
|
|
- **Desktop integration**: Dolphin (KDE) service menus for GUI sharing and access.
|
2025-09-14 19:44:37 +02:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
## 🔑 Commands
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
### Sharing
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```bash
|
2025-09-20 17:17:26 +02:00
|
|
|
|
backtunnel-share /path/to/folder with user@host for <duration> [options]
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```
|
2025-09-20 17:17:26 +02:00
|
|
|
|
- `-p, --tunnel-port` Remote bind port (default: 2222)
|
|
|
|
|
|
- `-l, --local-ssh-port` Local sshd port to expose (default: 22)
|
|
|
|
|
|
- `-i, --invite` Print invite line
|
|
|
|
|
|
- `--qr` Show QR code (requires qrencode)
|
|
|
|
|
|
- `--allow-key FILE` Authorize a provided public key
|
|
|
|
|
|
- `--allow-known NAME` Authorize a stored key (~/.config/backtunnel/authorized/NAME.pub)
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
### Accessing
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```bash
|
2025-09-20 17:17:26 +02:00
|
|
|
|
backtunnel-access /path/to/folder from user@host [options]
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```
|
2025-09-20 17:17:26 +02:00
|
|
|
|
- `-p, --port` Tunnel port (default: 2222)
|
|
|
|
|
|
- `-m, --mount-point` Local mount point (default: ~/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 17:17:26 +02:00
|
|
|
|
`~/.config/backtunnel/profiles.ini`:
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```ini
|
|
|
|
|
|
[default]
|
2025-09-20 17:17:26 +02:00
|
|
|
|
tunnel_port=2222
|
|
|
|
|
|
invite=true
|
|
|
|
|
|
invite_mount=$HOME/remote-rssh
|
2025-09-20 10:58:02 +02:00
|
|
|
|
|
|
|
|
|
|
[work]
|
|
|
|
|
|
user=alice
|
|
|
|
|
|
host=vps.example.com
|
2025-09-20 17:17:26 +02:00
|
|
|
|
tunnel_port=4422
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```
|
2025-09-20 17:17:26 +02:00
|
|
|
|
Usage:
|
2025-09-14 22:02:48 +02:00
|
|
|
|
```bash
|
2025-09-20 17:17:26 +02:00
|
|
|
|
backtunnel-share ~/reports with @work for 6h -i --allow-known alice
|
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
|
|
|
|
## 🖥️ Dolphin Integration
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
- **Share via BackTunnel…** – GUI dialog for sharer options.
|
|
|
|
|
|
- **Access via BackTunnel…** – GUI dialog for accessor options.
|
2025-09-14 22:02:48 +02:00
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
Logs are written to:
|
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 17:17:26 +02:00
|
|
|
|
### From source
|
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 17:17:26 +02:00
|
|
|
|
### Arch Linux
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
2025-09-20 17:17:26 +02:00
|
|
|
|
makepkg -si
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```
|
2025-09-19 15:30:41 +02:00
|
|
|
|
|
2025-09-20 17:17:26 +02:00
|
|
|
|
Uninstall:
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```bash
|
2025-09-20 17:17:26 +02:00
|
|
|
|
sudo bash scripts/uninstall.sh
|
|
|
|
|
|
# or with purge of defaults
|
|
|
|
|
|
sudo PURGE=1 bash scripts/uninstall.sh
|
2025-09-20 10:58:02 +02:00
|
|
|
|
```
|
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 17:17:26 +02:00
|
|
|
|
## 📖 Documentation
|
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
|
2025-09-20 17:17:26 +02:00
|
|
|
|
GNU GPL v3.0
|
2025-09-20 10:58:02 +02:00
|
|
|
|
© 2025 LUXIM d.o.o., Slovenia – Matjaž Mozetič
|