maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N810 (https://talk.maemo.org/forumdisplay.php?f=28)
-   -   ssh tunneling: how to ? (https://talk.maemo.org/showthread.php?t=26019)

skatebiker 2009-01-05 21:13

ssh tunneling: how to ?
 
I want to use ssh tunneling via a proxy server.
So I do (as root) on the tablet

ssh -D80 user@myserver.com

and the I want to set the proxy for the browser to localhost:80 but I cannot set the proxy. I can only set the proxy per connection, which means that the ssh connection also goes over the proxy.

Is there a way that I can only proxy certain ports or with a particular program ?

UPDATE: I found in this thread http://www.internettablettalk.com/fo...ad.php?t=11294
that I can set a proxy in about:config.
It did work with the same wrong result as setting the connection proxy:
while
ssh -D 80 user@myserver

was open, the browser returned an empty page without error.

Any ideas on this ?

qole 2009-01-06 00:10

Re: ssh tunneling: how to ?
 
skatebiker:

Try a different proxy port. You shouldn't use port 80, since that is the "normal" HTTP port. Use something like 3210 (as in my example), because that is an unused port.

I haven't tried this for many months, but it should still work...

EDIT: Just tested things, still works!

EDIT2: Looks like you just have to hit your "turn proxy on" bookmark to turn the proxy on, rather than load the bookmark and then hit the submit button like you used to have to do.

EDIT3: don't forget to set network.proxy.socks_remote_dns to 1 or true for properly secure browsing...

brendan 2009-01-06 00:50

Re: ssh tunneling: how to ?
 
why the -D, and not -L? what does the Dynamic functionality offer?

Benson 2009-01-06 00:57

Re: ssh tunneling: how to ?
 
Quote:

Originally Posted by brendan (Post 254785)
why the -D, and not -L? what does the Dynamic functionality offer?

A SOCKS proxy, which can proxy any connection to anywhere, instead of a simple port-forward. With -L, you'd have to make a new one for each host you wanted to browse to, or (more feasibly) have a remote (HTTP or SOCKS) proxy and forward everything to it.

With -D, you don't need the remote proxy.

dick-richardson 2009-01-06 02:11

Re: ssh tunneling: how to ?
 
Not sure if it's what you're after, but I run a squid proxy at home, set up an ssh tunnel, and I change the proxy settings to route http and https traffic across the tunnel. Rather than being an application setting, it's an advanced setting in the connection dialog.

Either method you choose, use it in conjunction with dbus-scripts to have the tunnel established whenever you connect to a wifi access point.

skatebiker 2009-01-06 11:14

Re: ssh tunneling: how to ?
 
Quote:

Originally Posted by qole (Post 254765)
skatebiker:

Try a different proxy port. You shouldn't use port 80, since that is the "normal" HTTP port. Use something like 3210 (as in my example), because that is an unused port.

I haven't tried this for many months, but it should still work...

EDIT: Just tested things, still works!

EDIT2: Looks like you just have to hit your "turn proxy on" bookmark to turn the proxy on, rather than load the bookmark and then hit the submit button like you used to have to do.

EDIT3: don't forget to set network.proxy.socks_remote_dns to 1 or true for properly secure browsing...


Bit I see also a setting

network.proxy.http localhost
network.proxy.http_port 80

How can I remove these settings ?
The about config does not have an option to remove settings.
Setting an empty string does not remove it.

brendan 2009-01-06 13:13

Re: ssh tunneling: how to ?
 
ok, so -D is a socks-like attempt to proxy connections, but not really a socks proxy?

also, from my readings on privoxy and tor, does the -D forwarding "leak" DNS queries like socks4? when using privoxy in combination with tor, one must forward requests from privoxy to tor using only forward-socks4a directives to avoid DNS leaks.

skatebiker 2009-01-06 14:06

Re: ssh tunneling: how to ?
 
I finally succeeded with -D 3210.

I filled in
network.proxy.http <empty>
network.proxy.http_port 0

restarted the browser by clicking on a bookmark which sets network.proxy.type to 1.
Then I saw the IP address of the proxy to which I had an open SSH connection with -D 3210.

Benson 2009-01-06 15:54

Re: ssh tunneling: how to ?
 
Quote:

Originally Posted by brendan (Post 254887)
ok, so -D is a socks-like attempt to proxy connections, but not really a socks proxy?

It is a SOCKS proxy, just one that happens to route all proxied connections via a secure channel to the remote server.

Quote:

also, from my readings on privoxy and tor, does the -D forwarding "leak" DNS queries like socks4? when using privoxy in combination with tor, one must forward requests from privoxy to tor using only forward-socks4a directives to avoid DNS leaks.
AFAIK, it's SOCKS4/5 (not 4a, so requires IPs, not FQDNs), but it can handle any traffic, including DNS, if you make the DNS requests through the proxy. So if you can make your software (e.g. MicroB, which can) perform DNS lookup via TCP, you can push it through SOCKS to the DNS server, and then make a connection to the resulting IP through SOCKS. Qole's instructions included a setting for that. (I think...)

With an appropriately compiled TSOCKS, also, DNS can be forced to TCP, and SOCKSified. I'm not sure if a version compiled that way is about. (And TSOCKS, if you can get it working right, makes everything run through the tunnel instead of configuring each app separately.)

Finally, you could just use socat or netcat to run DNS over UDP over TCP over SSH -- it's not as hard as it sounds.

qole 2009-01-06 17:31

Re: ssh tunneling: how to ?
 
Quote:

Originally Posted by Benson (Post 254919)
So if you can make your software (e.g. MicroB, which can) perform DNS lookup via TCP, you can push it through SOCKS to the DNS server, and then make a connection to the resulting IP through SOCKS. Qole's instructions included a setting for that. (I think...)

I mentioned it in this thread, but my original instructions don't mention it.

Quote:

Originally Posted by qole (Post 254765)
don't forget to set network.proxy.socks_remote_dns to 1 or true for properly secure browsing...

Quote:

Originally Posted by Benson (Post 254919)
And TSOCKS, if you can get it working right, makes everything run through the tunnel instead of configuring each app separately...

Except the browser, sadly, which is why you have to do this convoluted way using about:config instead of the much more elegant tsocks.

There may be a way to restart browserd so that it uses tsocks, but in my experience, restarting browserd tends to have unwanted side effects.

Benson 2009-01-06 19:13

Re: ssh tunneling: how to ?
 
Quote:

Originally Posted by qole (Post 254940)
Except the browser, sadly, which is why you have to do this convoluted way using about:config instead of the much more elegant tsocks.

There may be a way to restart browserd so that it uses tsocks, but in my experience, restarting browserd tends to have unwanted side effects.

That's where the "if you can get it set up properly" comes in. :D Fortunately, Tear has come a long way towards beta lately.

daperl 2009-01-06 19:47

Re: ssh tunneling: how to ?
 
Quote:

Originally Posted by qole (Post 254940)
There may be a way to restart browserd so that it uses tsocks, but in my experience, restarting browserd tends to have unwanted side effects.

I restart browserd all the time. What kind of unwanted side effects should I be experiencing?

qole 2009-01-06 23:11

Re: ssh tunneling: how to ?
 
I mainly get missing UI elements. Could you post a howto for restarting browserd?

daperl 2009-01-06 23:44

Re: ssh tunneling: how to ?
 
First, I exit all browser windows. Then I watch and wait for the CPU to settle down (forget the name of the status bar plugin). And lastly, in an xterm I type:
Code:

sudo /etc/init.d/ta<tab>restart<return>
Or for the less lazy:
Code:

sudo /etc/init.d/tablet-browser-daemon restart<return>

qole 2009-01-07 00:00

Re: ssh tunneling: how to ?
 
hm, in order to get browserd to work with tsocks, it would involve a
Code:

sudo /etc/init.d/tablet-browser-daemon stop
and
Code:

sudo tsocks /etc/init.d/tablet-browser-daemon start
to work... I wonder if that would be successful? Anyone want to try and report?

BTW: why do you restart browserd "all the time"?

daperl 2009-01-07 00:58

Re: ssh tunneling: how to ?
 
There's a UI bug in there somewhere. Unfortunately, I can't faithfully reproduce it, but it seems to be related to either:

program switching and fast screen tapping

or maybe

page rendering and fast screen tapping

The result is a runaway CPU. It's probably a sight to see as I franticly try and get the program menu up to kill the b*stard(s). But because I'm a fanboy these things don't bother me much. In fact, I have another quirky browser workaround/speed-up:

First off, let me say, the X11 improvements from the last update are very welcome. That said, I have a strange suspicion that they might be involved in the above mentioned bug. Anyway, browser rendering speeds seem to increase when I minimize all browser windows that are in any stage of rendering; especially new ones from a tap-and-hold. It's kind of like a one-dimensional version of Whack-A-Mole, or in your case... I haven't done any formal analysis, but I would be shocked if it was just a busy-body placebo effect.

qole 2009-01-07 05:08

Re: ssh tunneling: how to ?
 
Quote:

Originally Posted by daperl (Post 255033)
The result is a runaway CPU... It's kind of like a one-dimensional version of Whack-A-Mole...

That paints a very interesting picture. daperl, madly whacking moles, as his CPU runs away into the sunset.

daperl 2009-01-07 06:23

Re: ssh tunneling: how to ?
 
Quote:

Originally Posted by qole (Post 255069)
That paints a very interesting picture. daperl, madly whacking moles, as his CPU runs away into the sunset.

Sad, true and funny. I live near the top of a high-rise building, and there have been moments where the n800 could have flown into the sunset.


All times are GMT. The time now is 01:19.

vBulletin® Version 3.8.8