2025-09-14 12:54:06 +02:00
.TH backtunnel 1 "September 2025" "1.2" "BackTunnel – Reverse SSH Sharing Toolkit"
2025-09-14 11:29:21 +02:00
.SH NAME
backtunnel-share, backtunnel-access \- Secure reverse SSH folder sharing and access
.SH SYNOPSIS
.B backtunnel-share
/path/to/folder with remoteuser:remotehost for <duration> [options]
.B backtunnel-access
/path/to/folder from remoteuser:remotehost [options]
.SH DESCRIPTION
\fB backtunnel-share\fR starts a reverse SSH tunnel from the local (sharing) machine to a remote, reachable host.
The tunnel exposes the local sshd (typically port 22) on a loopback port on the remote host using \fB ssh -R\fR .
The sharing ends automatically after the given \fI duration\fR via \fB timeout\fR .
2025-09-14 12:54:06 +02:00
With the \fB --invite\fR option, \fB backtunnel-share\fR prints a ready-to-copy access command for the remote user,
which can be pasted directly into a chat or terminal. The invite can also be rendered as a QR code or written to a file.
2025-09-14 11:29:21 +02:00
\fB backtunnel-access\fR mounts the shared folder from the remote side using \fB sshfs\fR by connecting to \fB localhost:<port>\fR on the remote host (the port exposed by \fB backtunnel-share\fR ).
.SH OPTIONS
.SS backtunnel-share options
.TP
.B -p, --tunnel-port <PORT>
Remote port to bind with \fB -R\fR (default: 2222).
.TP
.B -l, --local-ssh-port <PORT>
Local sshd port to forward to (default: 22).
2025-09-14 12:54:06 +02:00
.TP
.B -i, --invite
Print a ready-to-copy invite command for the remote user.
.TP
.B --invite-mount <PATH>
Mount point suggested in the invite (default: /mnt/remote-rssh).
.TP
.B --invite-file <FILE>
Also write the invite text (including unmount hint) to the given file.
.TP
.B --qr
Render the invite as a terminal QR code (requires \fB qrencode\fR ).
2025-09-14 11:29:21 +02:00
.SS backtunnel-access options
.TP
.B -p, --port <PORT>
Remote port on which the reverse tunnel listens (default: 2222).
.TP
.B -m, --mount-point <PATH>
Local mount point for sshfs (default: /mnt/remote-rssh).
.SH ARGUMENTS
.TP
.B /path/to/folder
Path to share (server) or to mount (client).
.TP
.B remoteuser:remotehost
Or \fB remoteuser@remotehost\fR . The remote host that accepts the initial SSH connection.
.TP
.B <duration>
Time to keep the share active. Accepts \fB n\fR \fI s\fR |\fI m\fR |\fI h\fR |\fI d\fR forms, e.g. 30m, 2h, 1d. Passed to \fB timeout\fR .
.SH EXAMPLES
.TP
Share for 2 hours on default ports:
.B backtunnel-share
/home/user/docs with alice@vps.example.com for 2h
.TP
Share for 1 day, using custom ports:
.B backtunnel-share
/home/user/docs with alice:vps.example.com for 1d -p 4422 -l 2222
2025-09-14 12:54:06 +02:00
.TP
Share with invite printed:
.B backtunnel-share
/home/user/docs with alice@vps.example.com for 2h -i
.TP
Share with QR invite:
.B backtunnel-share
/home/user/docs with alice@vps.example.com for 2h -i --qr
2025-09-14 11:29:21 +02:00
.TP
Mount with default port and mount point:
.B backtunnel-access
/home/user/docs from alice@vps.example.com
.TP
Mount with custom port and mount point:
.B backtunnel-access
/home/user/docs from alice@vps.example.com -p 4422 -m /mnt/alice-docs
.SH NOTES
By default, \fB ssh -R\fR binds to 127.0.0.1 on the remote side, limiting access to local users on the remote machine.
The client connects to \fB localhost:<port>\fR from the remote host.
2025-09-14 12:54:06 +02:00
The invite feature is intended for convenience: copy-paste the printed command into chat for the remote user.
Unmount with \fB fusermount -u <mountpoint>\fR after use.
2025-09-14 11:29:21 +02:00
.SH SEE ALSO
2025-09-14 12:54:06 +02:00
ssh(1), sshfs(1), timeout(1), autossh(1), qrencode(1), fusermount(1)
2025-09-14 11:29:21 +02:00
.SH AUTHOR
Matjaž Mozetič