Skip to main content

ssh-backchannel

WARNING. This is vibe coded. Review before use.

Sometimes I want to do things on my local machine from a remote machine I am ssh'd into. ssh-backchannel provides a means to do so - in a moderately secure way. It allows you to run a local command from a remote machine, while asking for confirmation from your local machine.

You must have ssh running on your machine and have an IP address addressable from another machine. This can work well if you are using a VPN or a local networing.

Architecture

A limited ssh key is created and passed to other machines when you log in. This key can only run a command which asks you for permission before running commands.

Installation

You can install ssh-backchannel with pipx.

pipx install ssh-backchannel

The set up your machine and the remote machine run.

ssh-backchannel configure ssh-backchannel setup-remote user@server

Also install backchannel on the remote macine.

Usage

Once you have setup you macine and the remote machine you can run:

ssh-backchannel run ls

To run ls on your home machine.

Alternatives and prior work

If you are happy with it you could use ssh auth forwarding and just ssh into your machine. This adds a little more security since you must approve each command.

If you just want to write to your clipboard there are tools which use OSC escape codes to send data via your terminal. The only downside is that you need to set up terminal to handle deal with this. I do not like debugging this sort of stuff.

Caveat

This only works if your host can be reached from the remote machine and may involve openning your machine ot the internet or using a VPN / being on the same subnet. Reverse proxying would probably be the easiest fix.

It is assumed that there is only one user who consistently uses a machine.

This only with X11.

Alternatively, you could use reverse proxying in your ssh config.

Metadata

Release files for ssh-backchannel 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ssh-backchannel 1.5.0
File Size Uploaded Provenance Actions
ssh_backchannel-1.5.0.tar.gz 4.2 kB Without provenance Details for ssh_backchannel-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ssh-backchannel 1.5.0
File Interpreter ABI Platform Actions
ssh_backchannel-1.5.0-py3-none-any.whl Python 3 none any Details for ssh_backchannel-1.5.0-py3-none-any.whl

Total release size: 9.0 kB

Release files / ssh_backchannel-1.5.0.tar.gz

Download URL ssh_backchannel-1.5.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
54f470448930af04ff519646830fc1eae38c32b6833d34b5077cf0e679cc01dd
BLAKE2b-256 checksum
How to use checksums
d86e14da5e4b007aa6cc8097a11af56025646850938f10e94d66a7e464948b59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / ssh_backchannel-1.5.0-py3-none-any.whl

Download URL ssh_backchannel-1.5.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a4a60aeb6520e139fc27b96898916ffd789285c588084977ec5c317f3264101
BLAKE2b-256 checksum
How to use checksums
cbe9441953c5d16e8cf448426dc4d3ba9ef3294a0a62c685c61f5952d19d877b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for ssh-backchannel 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page