diff --git a/Dockerfile b/Dockerfile index 24b247d43586244e771f5111a680110c72a57727..0a6b67de34a03357f8b5849ed1f7918956f828d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,7 +63,7 @@ RUN echo "deb [arch=$(dpkg --print-architecture)] \ ############################################################################### RUN apt-get -qq update \ && apt-get -yqq install x11-apps sudo wget git tmux vim meld openssh-server\ - build-essential cmake python-dev python3-dev \ + build-essential cmake python-dev python3-dev sshuttle openjdk-8-jdk\ && apt-get -yqq clean ############################################################################### @@ -165,6 +165,7 @@ RUN conda activate $ENV_PREFIX \ COPY docker_start.sh $HOME/docker_start.sh +COPY run_sshuttle.sh $HOME/run_sshuttle.sh RUN echo "source /home/"$USER"/local_host_home/docker_start.sh" >> ~/.bashrc USER $USER diff --git a/requirements.txt b/requirements.txt index 285b2c73d7524c7af3c177817d615cd2da35ee07..ec8683f11c00df7dddc2d34b1ed467a01811a923 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,4 +15,3 @@ seaborn bokeh awkward numba -cupy diff --git a/run_sshuttle.sh b/run_sshuttle.sh new file mode 100755 index 0000000000000000000000000000000000000000..0551322ecf0310516059cb79d38c625e7fe7ea71 --- /dev/null +++ b/run_sshuttle.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# From https://codimd.web.cern.ch/vjC8BHbTS7etHwJve-K2Uw + +case $1 in + connect) + sshuttle --dns -vr sterbini@lxplus.cern.ch 188.0.0.0/8 137.138.0.0/16 172.18.0.0/16 128.141.0.0/16 128.142.0.0/16 188.184.0.0/15 --daemon --pidfile /tmp/sshuttle.pid + shift + ;; + disconnect) + kill `cat /tmp/sshuttle.pid` + shift + ;; + *) + # unknown option + echo "Unknown option\nUsage:" + echo "\t $0 connect : to start VPN-like connection to CERN" + echo "\t $0 disconnect : to stop it" + ;; +esac