One‑command SSH → SOCKS5 → HTTP proxy installer for Linux desktops
autossh keeps the tunnel alive • gost bridges SOCKS→HTTP • systemd‑user manages everything
| done | feature |
|---|---|
| ✅ | Autoinstaller – generates an SSH key, copies it to the server, writes ~/.ssh/config |
| ✅ | Self‑healing tunnel – autossh restarts the connection if it drops |
| ✅ | Dual proxy – exposes SOCKS5 (127.0.0.1:10808) and HTTP (127.0.0.1:9001) |
| ✅ | User‑level service – neat ssh-proxy.service in systemd‑user (no root) |
| ✅ | Single binary script – just drop ssh-proxy.sh into $PATH |
| ✅ | Reconfigure / start / stop / status / uninstall commands |
# 1. Download & make executable
curl -fsSL https://raw.githubusercontent.com/ars2062/ssh-proxy/main/ssh-proxy.sh \
-o ssh-proxy && chmod +x ssh-proxy
# 2. Run the installer (follow the prompts)
./ssh-proxy install
# 3. Enjoy – point your apps to 127.0.0.1:9001 (HTTP) or :10808 (SOCKS5)Tip: keep the script somewhere in
$PATH(e.g.~/bin/) so you can typessh-proxy statusany time.
This repo includes a versioned .githooks/pre-commit script to automatically check for mistakes before every commit.
To enable it, run:
bash scripts/setup.shThis sets up Git to use the shared hooks, so they apply to all contributors.
💡 Run this once after cloning the repo.
| command | description |
|---|---|
install (default) |
interactive setup & service creation |
reconfigure |
reinstall from scratch (destroys existing config) |
start / stop |
start or stop the proxy service |
status |
show tunnel status and last logs (systemctl --user status) |
uninstall |
nuke service, config, and optionally the SSH key |
help |
pretty usage banner |
- Linux desktop with systemd (user units enabled)
ssh,ssh-copy-id,ssh-keygenautosshgost≥ v3 (the script fetches it for you if missing)
The installer can auto‑install missing packages on apt, dnf, or pacman based systems.
| path | purpose |
|---|---|
~/.config/ssh-proxy/config |
plain‑text shell vars (remote host, ports, etc.) |
~/.config/systemd/user/ssh-proxy.service |
generated user unit |
~/.ssh/id_ed25519_ssh-proxy |
dedicated key pair for the tunnel |
~/.ssh/config |
adds a Host ssh-proxy section |
Edit them manually if you like, then run systemctl --user daemon-reload && ssh-proxy restart.
- The script uses a dedicated SSH key tagged
ssh-proxy; you may restrict it server‑side (from="127.0.0.1",command="/bin/false"…). - Runs entirely as your local user – no root privileges after installation.
autosshadds a keepalive every 30 s (AUTOSSH_POLL)
- Multi‑hop (jump host) support
- macOS support via launchd
- Split
gost&autosshinto separate services - Optional
iptablesfunction to block non‑proxy traffic
Feel free to open an issue or PR if you’d like to help!
- Fork 📌
- Create a feature branch 🌱 (
git checkout -b feat/cool‑thing) - Commit your changes 📝
- Open a PR and describe why + how 📨
Please run shellcheck before submitting (
shellcheck ssh-proxy.sh).
For larger changes, open an issue first so we can discuss the design.
Released under the MIT License – see LICENSE for details.
© 2025 Arshia Moghaddam
