Remote Bash Shell (remote-bash)
🚀 Make Your Remote Server Feel Local — Instantly
Tired of juggling rsync, scp, or NFS just to work with a remote server?
Need the power of a remote GPU server, but still want the comfort of editing locally?
remote-bash lets you mount your local directory directly into a remote server, run commands there, and clean up when you’re done — all with one command.
No messy setup, no permanent SSH key sharing, no manual reverse tunnels.
✨ How It Works (Version 2.0.0)
When you run:
rbash myserver
Here’s what happens under the hood:
- Validate Host – confirms that
myserverexists in your~/.ssh/config(but can proceed even if missing). - Prepare Remote Workspace – creates a unique workspace folder (e.g.,
/home/user/workspace12345678) on the remote machine. - Temporary SSH Key Exchange
- Generates a remote-only keypair.
- Adds the remote public key to your local
authorized_keys(with a special tag for later removal).
- Reverse SSH Tunnel – opens a reverse tunnel from the remote back to your local machine.
- SSHFS Mount – mounts your local working directory into the remote workspace using the reverse tunnel.
- Interactive Remote Bash – drops you into a bash shell on the remote with your local files mounted and ready.
- Automatic Cleanup (on exit) – unmounts the workspace, deletes temporary keys (both sides), and removes the workspace folder.
🔹 Why Use This Instead of NFS / Manual SSHFS?
- No permanent key sharing — security-friendly
- No root or NFS setup — works in user space
- Automatic reverse tunnel — works even if remote server can’t directly reach your machine
- One command — handles mount, shell, and cleanup for you
- Python-powered — portable and easily installed via
pip
📦 Installation
pip install remote-bash
Requires:
- Python 3.8+
sshclient installed locallysshfsinstalled locally and remotely- FUSE enabled on both machines
🔹 Example Usage
List available hosts from your SSH config:
rbash
Connect to a host:
rbash myserver
Mount a specific local path:
rbash myserver --path ~/projects/myapp
Change the base reverse tunnel port:
rbash myserver --port 2225
Strict host key checking (disable host-key suppression):
rbash myserver --strict
🛠 Requirements
Local
- Python 3.8+
sshsshfs
Remote
sshsshfs- FUSE enabled
⚙ SSH Configuration Example
~/.ssh/config:
Host myserver
HostName 192.168.1.100
User ubuntu
IdentityFile ~/.ssh/id_rsa
🔍 Security
- All SSH keys used are temporary and automatically removed.
- Your
authorized_keysentry is tagged, so it’s deleted after the session. - No changes are made to system-level SSH configuration.
- Reverse tunnel exists only for the duration of your session.
🧼 Cleanup Behavior
When you exit the remote bash session:
- Workspace is unmounted
- Temporary SSH keys are deleted
- Reverse tunnel is closed
- Authorized key entry is removed
If you pass --no-clean, keys and mounts remain for debugging.
🐛 Troubleshooting
Permission Denied
Ensure your SSH connection to the host works manually:
ssh myserver
sshfs not found
Install on both local and remote:
sudo apt install sshfs # Ubuntu/Debian
brew install sshfs # macOS
remote port forwarding failed
The requested port is in use on remote; rbash will automatically select an available one starting from --port.
fuse: unknown option(s): -o nonempty
Remove -o nonempty. Newer FUSE versions don’t support it. remote-bash doesn’t use it.
📄 License
MIT License — see LICENSE.
📜 Changelog
[2.0.0] - 2025-08-10
Changed
- Completely rewrote core logic in Python (
remote.pyclass +cli.pyentrypoint) replacing older shell script. - Manages session lifecycle programmatically (prepare, run, clean).
- Temporary SSH key injection/removal to local
authorized_keys. - Local port availability check before starting reverse tunnel.
- Clear subprocess logging and error handling.
[1.2.0] - 2025-08-01
Fixed
- Remote system check for
sshfsand FUSE before attempting mount.
[1.1.0] - 2025-07-31
Fixed
- Corrected path resolution for
bash.sh.
[1.0.1] - 2025-07-31
Added
- README updated with
pip install remote-bash.
[1.0.0] - 2025-07-31
Added
- Initial release of
remote_bash. - CLI commands:
rbashandremote_bash. - Reverse SSHFS mounting with local → remote path mapping.
- Remote temporary SSH key exchange.
- Automatic cleanup of keys, mounts, and workspace.
- Host listing from
~/.ssh/configin table format.
Metadata
Release files for remote-bash 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| remote_bash-2.0.0.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| remote_bash-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.3 kB
Release files / remote_bash-2.0.0.tar.gz
| Download URL | remote_bash-2.0.0.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
798ca4054677a4e78778ee9f64f9ef0e82f8dc4c450afc9a6ef19276de82b8eb
|
|
BLAKE2b-256 checksum How to use checksums |
88d30010a01b17fa7bc44422e7e27bfcbbcc6b92a4b0859ccea2e20e0f8c214d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / remote_bash-2.0.0-py3-none-any.whl
| Download URL | remote_bash-2.0.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a859428fbfb63de7d3a2330f5ecf5fd250494570adff728b72abef58a029e4e9
|
|
BLAKE2b-256 checksum How to use checksums |
14e3465329b0215636920953bb71bcc1ddb7ebfdd231ef6a682c8618ce7084eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|