En CYGWIN, quiero un script bash a:script bash para configurar un túnel SSH temporal
- crear un túnel SSH a un servidor remoto.
- Trabaja un poco localmente que utiliza el túnel.
- Luego cierre el túnel.
La "parte de apagado" me tiene perplejo.
Actualmente, tengo una solución poco convincente. En un shell ejecuto lo siguiente para crear un túnel.
# Create the tunnel - this works! It runs forever, until shell is quit.
ssh -nNT -L 50000:localhost:3306 [email protected]
Luego, en otra ventana de shell, hago mi trabajo
# Do some MYSQL stuff over local port 50000 (which goes to remote port 3306)
Por último, cuando haya terminado. Cierro la primera ventana de shell para matar el túnel.
me gustaría hacer todo esto en un script como: # Crear túnel # funcionan túnel # Kill
¿Cómo puedo realizar un seguimiento del proceso de túnel, así que sé cuál de ellos para matar ?
Escribí un script que ayudaría a hacer ssh tunneling, puede consultarlo en: https://github.com/gdbtek/ssh-tunneling.git –