101 lines
2.6 KiB
Markdown
101 lines
2.6 KiB
Markdown
# BackTunnel – Reverse SSH Folder Sharing Toolkit
|
||
|
||
Share and mount folders between Linux machines behind NAT/firewalls using two friendly commands.
|
||
|
||
## ✨ Commands
|
||
|
||
### `backtunnel-share`
|
||
Start a reverse SSH tunnel from the *sharing* machine for a limited time.
|
||
|
||
```bash
|
||
backtunnel-share /path/to/folder with remoteuser:remotehost for <duration> [options]
|
||
# or: remoteuser@remotehost
|
||
```
|
||
|
||
**Duration formats:** `30m`, `2h`, `1d` (passed to `timeout`)
|
||
|
||
**Options**
|
||
- `-p, --tunnel-port <PORT>`: Remote port to expose with `-R` (default: 2222)
|
||
- `-l, --local-ssh-port <PORT>`: Local sshd port to forward to (default: 22)
|
||
- `-i, --invite`: Print a ready-to-copy access command for the remote user
|
||
- `--invite-mount <PATH>`: Suggest mount point in the invite (default: `/mnt/remote-rssh`)
|
||
- `--invite-file <FILE>`: Also write the invite text (including unmount hint) to a file
|
||
- `--qr`: Render the invite as a QR code (requires `qrencode`)
|
||
|
||
**Examples**
|
||
```bash
|
||
# Share for 2h
|
||
backtunnel-share ~/projects with alice@vps.example.com for 2h
|
||
|
||
# Share and print a one-liner invite for chat
|
||
backtunnel-share ~/projects with alice@vps.example.com for 2h -i
|
||
|
||
# Share with custom ports and QR invite
|
||
backtunnel-share ~/projects with alice@vps.example.com for 1d -p 4422 -l 2222 -i --qr
|
||
```
|
||
|
||
The invite will look like this and can be pasted on the remote host:
|
||
```bash
|
||
backtunnel-access '/home/user/projects' from alice@vps.example.com -p 4422 -m '/mnt/remote-rssh'
|
||
```
|
||
|
||
Unmount on the remote side with:
|
||
```bash
|
||
fusermount -u /mnt/remote-rssh
|
||
```
|
||
|
||
### `backtunnel-access`
|
||
Mount a folder from the *remote* side via SSHFS.
|
||
|
||
```bash
|
||
backtunnel-access /path/to/folder from remoteuser:remotehost [options]
|
||
# or: remoteuser@remotehost
|
||
```
|
||
|
||
**Options**
|
||
- `-p, --port <PORT>`: Port on the remote host where the reverse tunnel listens (default: 2222)
|
||
- `-m, --mount-point <PATH>`: Local mount point (default: `/mnt/remote-rssh`)
|
||
|
||
---
|
||
|
||
## 🧰 Dolphin Service Menus
|
||
|
||
Two context actions for Dolphin:
|
||
- **Share via BackTunnel…** (right-click a folder on the sharing machine)
|
||
- **Access via BackTunnel…** (right-click a folder path on the remote machine)
|
||
|
||
Installed into:
|
||
- Plasma 6: `/usr/share/kio/servicemenus/`
|
||
- Plasma 5: `/usr/share/kservices5/ServiceMenus/`
|
||
|
||
---
|
||
|
||
## 🔐 Requirements
|
||
- `ssh`, `sshfs`, `timeout`, `konsole`, `kdialog`
|
||
- Optional:
|
||
- `bash-completion`
|
||
- `qrencode` (for QR-code invites)
|
||
|
||
---
|
||
|
||
## 📦 Install
|
||
```bash
|
||
sudo bash scripts/install.sh
|
||
```
|
||
Uninstall:
|
||
```bash
|
||
sudo bash scripts/uninstall.sh
|
||
```
|
||
|
||
---
|
||
|
||
## 📖 Man Page
|
||
```bash
|
||
man backtunnel
|
||
```
|
||
|
||
---
|
||
|
||
## 🧾 License
|
||
Licensed under **GNU GPL v3.0**. See `LICENSE`.
|