Fixes ssh tunnel command setup. Also fixes #3671
Merge pull request #3684 from amitmurthy/amitm/tunnel

Fixes ssh tunnel command setup. Also fixes #3671