Automatically start ssh sessions on login
Hi
I use Kubuntu 9.10.
I am frequently away from my office network. So I use OpenSSH to create a SOCKS proxy to one of the edge servers at the office: ssh -D 3080 myoffice.
This works just fine. However, I would like to have this SSH session set up automatically when I log in. This should be easy enough: create a shellscript that sets up the connection, put a link in ~/.kde/Autostart that points to this shellscript... The problem is though that I use an encrypted SSH key. So I have also put this python-script in Autostart:
http://
(the script opens an input box where I input my ssh key passphrase, and then it sets up ssh-agent with my key)
So, if I just start the ssh session on login, ssh will ask for my ssh key passphrase (because I have not entered it yet).
What I would like help on is this:
1: How do I have the ssh session set up automatically, when I have logged in AND I have added my ssh key to ssh-agent?
2: How do I make sure this is only done, when I am outside of the office network (if I am already at the office, this is not necessary)?
3: How do I make the ssh session start up again, if it is brought down for some reason (e.g. if I suspend the laptop or the network access is temporarily down)?
I am looking forward to hearing your input.
Thanks.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu openssh Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- tdn
- Solved:
- Last query:
- Last reply:
This question was reopened
- by tdn