Last active
March 3, 2018 00:26
-
-
Save ansell/65365c90435d7534eb1be294e2a26a8d to your computer and use it in GitHub Desktop.
sshuttle usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
VIRTUAL_ENV_DIR="${HOME}/python-virtualenvironments/sshuttle" | |
GITREPOS_DIR="${VIRTUAL_ENV_DIR}/gitrepos" | |
SSHUTTLE_REPO="${GITREPOS_DIR}/sshuttle" | |
# Set these to match your server | |
TUNNEL_USER="${USER}" | |
TUNNEL_SERVER="your-server" | |
if [[ ! -e "${VIRTUAL_ENV_DIR}" ]] ; | |
then | |
virtualenv -p python3 "${VIRTUAL_ENV_DIR}" | |
fi | |
echo "Virtual environment setup complete" | |
. "${VIRTUAL_ENV_DIR}"/bin/activate | |
echo "Virtual environment activated" | |
if [[ ! -e "${SSHUTTLE_REPO}" ]] ; | |
then | |
mkdir -p "${GITREPOS_DIR}" | |
cd "${GITREPOS_DIR}" | |
git clone https://github.com/sshuttle/sshuttle.git "${SSHUTTLE_REPO}" | |
cd "${SSHUTTLE_REPO}" | |
echo "Installing sshuttle" | |
./setup.py install --user | |
fi | |
echo "Running sshuttle using ${TUNNEL_USER}@${TUNNEL_SERVER}" | |
sshuttle --dns -r "${TUNNEL_USER}"@"${TUNNEL_SERVER}" 0/0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment