How about using an ssh-key setup, as Source Lab suggested, but setting up your key with a pass phrase and make sure ssh-agent is running on your machine so it only needs to be entered once per login session.
There's a few advantages doing it that way:
- You can get automated password-less login (apart from first boot/login) whenever you issue your ssh command
- Your key has a pass phrase so it's safer
- Using pub/private keys is very standard and will be supported by most SSH Server installations
To set up SSH key authentication:
To use ssh-agent/keychain (to cache the pass-phrase throughout the login session):
As far as automating the tunnel creation on startup, one idea might be to create a quick shell script which starts the tunnel:
~$ sudo cat <<EOF >> /usr/local/bin/start_tunnel.sh
ssh-add # ensure key is added to agent
ssh -D 9000 user@userserver # substitute real server in here (of course)
EOF
~$ chmod +x /usr/local/bin/start_tunnel.sh
Then add it as a startup program (System -> Preferences -> Startup Applications), should work, anyway!