3
votes
2answers
5k views

How to manage tunnels as background processes from a shell script?

I need to set up a couple of ssh-tunnels from a shell script. I've tried running them as bg tasks using: #!/bin/sh ssh -L 3000:server1:5029 me@server2 & ssh -L 3001:server3:3306 me@server2 & ...