I'm creating SOCKS 5 tunnel via ssh:
ssh -D 1337 -f -C -c blowfish -q -N user@host
I only need it for a fast and loose client connection, and then it's no longer needed.
I would like it to close after x seconds of being active automatically. I've tried postfixing sleep 10
, which would potentially even stay open till a connected client disconnects, but otherwise closes after 10 seconds.
When I run this:
ssh -D 1337 -f -C -c blowfish -q -N user@host sleep 10
the tunnel never closes.
I could sleep 10 in the bash script then find the process and kill it, but I was under the impression it could be simpler than that.