====== SOCKS Proxy server para proveer internet en loginnodes ======
===== Paso 1: En equipo local con acceso a Internet =====
Es necesario [[acceso_a_clementina|conectarse a la VPN]] de Clementina.
Luego, habilitar un SOCKS proxy
**Terminal 1: **ssh -N -D 1080 localhost
**Terminal 2:**
ssh -J @172.29.3.3 @172.28.253.11 -R 1081:localhost:1080 -N
===== Paso 2: Dentro de Clementina XXI =====
Paso 3)
curl --socks5-hostname localhost:1081 http://example.com
Una vez que comprobamos que el túnel funciona correctamente:
export http_proxy=socks5h://localhost:1081
export https_proxy=socks5h://localhost:1081
Ahora podemos realizar curl normalmente:
curl http://example.com/
====== Ejemplos ======
===== wget =====
Si necesitas descargar un tar file, wget no funciona, se puede hacer
curl -LO
===== pip =====
El entorno de Python debe tener instalado el paquete PySocks.
Descargar el paquete en un entorno con acceso a Internet.
pip download --only-binary=:all: --platform manylinux2014_x86_64 pysocks
Collecting pysocks
Downloading PySocks-1.7.1-py3-none-any.whl.metadata (13 kB)
Downloading PySocks-1.7.1-py3-none-any.whl (16 kB)
Saved ./PySocks-1.7.1-py3-none-any.whl
Successfully downloaded pysocks
Copiar el .whl a Clementina:
scp PySocks-1.7.1-py3-none-any.whl clementina:
Dentro del enviroment targeteado:
pip install PySocks-1.7.1-py3-none-any.whl
Processing ./PySocks-1.7.1-py3-none-any.whl
Installing collected packages: PySocks
Successfully installed PySocks-1.7.1
Si las variables de entorno ''$http_proxy'' y ''$https_proxy'' están seteadas correctamente sobre el proxy socks, pip debería funcionar normalmente.