mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-29 05:38:59 +02:00
Transparent proxy server that works as a poor man's VPN. Forwards over ssh. Doesn't require admin. Works with Linux and MacOS. Supports DNS tunneling.
This is an alternative solution to pull request #611. Previously, sshuttle would use doas on OpenBSD and sudo on Linux. However, some Linux distributions are opting to use doas. This patch changes the logic so that there can be multiple attempts to elevate privilages. If the first command fails to run, it moves on to the next command. Part of the existing code looked like it might be attempting to do this, but it didn't work. It also looks for the presence of doas and sudo in the path. If we can find doas (but cannot find sudo) or if the platform is OpenBSD, we try doas first. Otherwise, we try sudo, then doas. We try all the options until one succeeds (including running the command without sudo or doas) regardless of what is in the path. I'm open to adjusting the logic here based on feedback. If systems have both sudo and doas, they might be configured to give different users different permissions. For example, if a user wishes to use doas on this system, sshuttle would try sudo first and the user would need to enter invalid passwords to eventually cause sudo to fail and cause sshuttle to then try doas. This might not be ideal, but it avoids implement another sshuttle argument that the user would need to specify. Perhaps machines actually using doas will not have sudo installed? |
||
---|---|---|
.github | ||
bin | ||
docs | ||
sshuttle | ||
tests | ||
.gitignore | ||
.prospector.yml | ||
bandit.yml | ||
CHANGES.rst | ||
LICENSE | ||
MANIFEST.in | ||
README.rst | ||
requirements-tests.txt | ||
requirements.txt | ||
run | ||
setup.cfg | ||
setup.py | ||
tox.ini |
sshuttle: where transparent proxy meets VPN meets ssh ===================================================== As far as I know, sshuttle is the only program that solves the following common case: - Your client machine (or router) is Linux, FreeBSD, or MacOS. - You have access to a remote network via ssh. - You don't necessarily have admin access on the remote network. - The remote network has no VPN, or only stupid/complex VPN protocols (IPsec, PPTP, etc). Or maybe you *are* the admin and you just got frustrated with the awful state of VPN tools. - You don't want to create an ssh port forward for every single host/port on the remote network. - You hate openssh's port forwarding because it's randomly slow and/or stupid. - You can't use openssh's PermitTunnel feature because it's disabled by default on openssh servers; plus it does TCP-over-TCP, which has `terrible performance`_. .. _terrible performance: https://sshuttle.readthedocs.io/en/stable/how-it-works.html Obtaining sshuttle ------------------ - Ubuntu 16.04 or later:: apt-get install sshuttle - Debian stretch or later:: apt-get install sshuttle - Arch Linux:: pacman -S sshuttle - Fedora:: dnf install sshuttle - openSUSE:: zypper in sshuttle - Gentoo:: emerge -av net-proxy/sshuttle - NixOS:: nix-env -iA nixos.sshuttle - From PyPI:: sudo pip install sshuttle - Clone:: git clone https://github.com/sshuttle/sshuttle.git cd sshuttle sudo ./setup.py install - FreeBSD:: # ports cd /usr/ports/net/py-sshuttle && make install clean # pkg pkg install py36-sshuttle - macOS, via MacPorts:: sudo port selfupdate sudo port install sshuttle It is also possible to install into a virtualenv as a non-root user. - From PyPI:: virtualenv -p python3 /tmp/sshuttle . /tmp/sshuttle/bin/activate pip install sshuttle - Clone:: virtualenv -p python3 /tmp/sshuttle . /tmp/sshuttle/bin/activate git clone https://github.com/sshuttle/sshuttle.git cd sshuttle ./setup.py install - Homebrew:: brew install sshuttle - Nix:: nix-env -iA nixpkgs.sshuttle Documentation ------------- The documentation for the stable version is available at: https://sshuttle.readthedocs.org/ The documentation for the latest development version is available at: https://sshuttle.readthedocs.org/en/latest/ Running as a service -------------------- Sshuttle can also be run as a service and configured using a config management system: https://medium.com/@mike.reider/using-sshuttle-as-a-service-bec2684a65fe