I want to write a little script which sets up a socks proxy via ssh and then starts a browser using that proxy.#!/bin/bashssh -D 1234 user@host #&chromium-browser --proxy-server=socks5://127.0.0.1:1234If I add the &-sign at the end of the first line the script just asks for my password and then opens an ssh terminal. The browser is started not before the ssh terminal is closed which is pretty useless. If I add the &-sign the script doesn't wait until I typed in the password and I don't know how I can cleanly end the ssh session. I don't want to use automatic ssh login via rsa-keys. Any suggestions how I could circumvent the problems described above?
Have bash script wait for password
shell;ssh;background process
You might be interested in the -f option to ssh which makes it go to the background once the password has been obtained.