Skip to content

One-command SSH → SOCKS5 → HTTP proxy installer for Linux desktopsautossh keeps the tunnel alive  •  gost bridges SOCKS→HTTP  •  systemd-user manages everything

License

Notifications You must be signed in to change notification settings

ars2062/ssh-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssh‑proxy

One‑command SSH → SOCKS5 → HTTP proxy installer for Linux desktops
autossh keeps the tunnel alive  •  gost bridges SOCKS→HTTP  •  systemd‑user manages everything

ssh-proxy banner

Shell License PRs Welcome


✨ Features

done feature
Autoinstaller – generates an SSH key, copies it to the server, writes ~/.ssh/config
Self‑healing tunnelautossh 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

🚀 Quick start

# 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 type ssh-proxy status any time.


🧪 Git hooks

This repo includes a versioned .githooks/pre-commit script to automatically check for mistakes before every commit.

To enable it, run:

bash scripts/setup.sh

This sets up Git to use the shared hooks, so they apply to all contributors.

💡 Run this once after cloning the repo.


🛠 Commands

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

📋 Prerequisites

  • Linux desktop with systemd (user units enabled)
  • ssh, ssh-copy-id, ssh-keygen
  • autossh
  • gost ≥ v3 (the script fetches it for you if missing)

The installer can auto‑install missing packages on apt, dnf, or pacman based systems.


⚙️ Configuration files

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.


🔒 Security notes

  • 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.
  • autossh adds a keepalive every 30 s (AUTOSSH_POLL)

🏗 Roadmap / Ideas

  • Multi‑hop (jump host) support
  • macOS support via launchd
  • Split gost & autossh into separate services
  • Optional iptables function to block non‑proxy traffic

Feel free to open an issue or PR if you’d like to help!


🤝 Contributing

  1. Fork 📌
  2. Create a feature branch 🌱 (git checkout -b feat/cool‑thing)
  3. Commit your changes 📝
  4. 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.


📄 License

Released under the MIT License – see LICENSE for details.

© 2025 Arshia Moghaddam

About

One-command SSH → SOCKS5 → HTTP proxy installer for Linux desktopsautossh keeps the tunnel alive  •  gost bridges SOCKS→HTTP  •  systemd-user manages everything

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages