8
5
I am working at an university as research assistant. Often I would like to connect from home to university resources over http or ssh, but they are blocked from outside access. Therefore, they have a front-end ssh server where we can ssh into and from there to other hosts. For http access they advise to set up an ssh tunnel like this
ssh -L 1234:proxyserver.university.fi:8080 publicsshserver.university.fi
and put the proxy settings of your browser to point to port 1234
All nice and working, but I would not like to let all my other internet traffic go over this proxy server, and everytime I want to connect to the university I have to do this steps again.
What would I like:
- Set up a ssh tunnel everytime I log in my computer. I have a certificate, so no passwords are needed
- Have a way to redirect some wildcard-domains always through the ssh-server first. So that when I type intra.university.fi in my browser, transparently the request is going through the tunnel. Same when I want to ssh into another resource within the university
Is this possible? For the http part I think I maybe should set up my own local transparent proxy to have this easily done. How about the ssh part?
Where exactly are you pointing things to port 1234? I don't see that in the example in step 2 – Peter Smit – 2010-03-14T19:20:05.610
This answer is not perfect yet, but still I accept it as it is the best and the deadline is in an hour. Can you still answer my question above here? – Peter Smit – 2010-03-15T04:40:38.503
This answer requires you to always connect to port 1234, which means an awful lot of typing/changing URLs. Also, if you use the .loc TLD instead of whatever the real TLD was, name-based virtual hosts will stop working. I am curious as to why you did not respond to my PAC suggestion below, as it only requires you to add the URLs in one place (the PAC file). – janmoesen – 2010-03-15T07:40:59.347
updated question – Xeoncross – 2010-03-15T15:57:23.273
1What does the port thing in the hosts file do? – janmoesen – 2010-03-15T21:32:18.863
It should route all requests to
university.fi
tolocalhost:1234
- though I might be mistaken. – Xeoncross – 2010-03-16T01:24:08.2601You are. Gravely. From
man hosts
:IP_address canonical_hostname [aliases...]
. IMO, this is not an adequate solution. – janmoesen – 2010-03-19T12:15:48.9871Note that multiple hosts for the same IP address can just be placed on one line, so your example could be rewritten as
127.0.0.1 localhost ubuntu-64-desktop university.fi
. – Mathias Bynens – 2011-04-01T12:58:51.400