Using ssh in scripts (one-click secure VNC connection using krdc)

Using ssh in scripts (one-click secure VNC connection using krdc) I wanted to establish a VNC connection that is tunneled via ssh and just by one click. I created a shell script with the following content: !/bin/sh ssh -L 5902:192.168.0.7:5902 -f -N jeltsch@192.168.0.7 krdc localhost:2 The ssh connection remains open in the background until the krdc application has finished.