public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Socks-ifying an application
@ 2012-05-15  9:50 Mick
  2012-05-15 14:45 ` Alan McKinnon
  0 siblings, 1 reply; 6+ messages in thread
From: Mick @ 2012-05-15  9:50 UTC (permalink / raw
  To: gentoo-user

I am not sure what I am doing wrong, but I can't seem to be able to get
tsocks, or proxychains working.

I set up a socks server virtue of ssh dynamic port forwarding:

$ ssh -D localhost:12465 root@10.10.10.12

Then I run:

$ . tsocks on
$ tsocks sh
LD_PRELOAD="/lib/libtsocks.so"
$ tsocks firefox

or tsocks kmail, or tsocks <anything else>.

The connection is not sent out via the server on 10.10.10.12.  The terminal
that ran tsocks does not reveal anything in terms of a connection taking
place, at least not when I run firefox.  With Chromium things are more
revealing:

$ . tsocks on
$ tsocks sh
LD_PRELOAD="/lib/libtsocks.so"
$ tsocks chromium
[4591:4604:405018909:ERROR:object_proxy.cc(239)] Failed to call
method: org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.NetworkManager was not provided by any .service files
ERROR: ld.so: object '/lib/libtsocks.so' from LD_PRELOAD cannot be
preloaded: ignored.


Exporting like this, also fails to load it for chromium:

$ export LD_PRELOAD=/lib/libtsocks.so
$ tsocks sh
LD_PRELOAD="/lib/libtsocks.so"
$ tsocks chromium
[5052:5065:973215173:ERROR:object_proxy.cc(239)] Failed to call
method: org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.NetworkManager was not provided by any .service files
ERROR: ld.so: object '/lib/libtsocks.so' from LD_PRELOAD cannot be
preloaded: ignored.



If I set up socks within the firefox application Advanced/Network
settings, without using tsocks, the connection succeeds through the
ssh tunnel.  Therefore I am confident that the tunnel itself is
working as a socks5 server.


This is what I have in /etc/socks/tsocks.conf

server = 127.0.0.1
server_type = 5
server_port = 12465

Similarly, I get no connection if I use proxychains.

Any idea what I am doing wrong here?

-- 
Regards,
Mick



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Socks-ifying an application
  2012-05-15  9:50 [gentoo-user] Socks-ifying an application Mick
@ 2012-05-15 14:45 ` Alan McKinnon
  2012-05-15 15:57   ` Mick
  0 siblings, 1 reply; 6+ messages in thread
From: Alan McKinnon @ 2012-05-15 14:45 UTC (permalink / raw
  To: gentoo-user

On Tue, 15 May 2012 10:50:43 +0100
Mick <michaelkintzios@gmail.com> wrote:

> I am not sure what I am doing wrong, but I can't seem to be able to
> get tsocks, or proxychains working.
> 
> I set up a socks server virtue of ssh dynamic port forwarding:
> 
> $ ssh -D localhost:12465 root@10.10.10.12
 
This part is fine.

I tried the next part. It didn't work nicely for me. 

So what I do now is:

Firefox + FoxyProxy

and now I can set my proxy individually per site. All the internal work
stuff accessed from home goes through the proxy, except the three sites
only viewable from the outside; and everything else bypasses the proxy.

Much better than trying to deal with a global proxy (although foxyproxy
will do that too if that is what you need.

And dispense with all the tsocks stuff.

I see recent KDE now also supports socks. This is a nice new addition
so konqueror can also use it.




> 
> Then I run:
> 
> $ . tsocks on
> $ tsocks sh
> LD_PRELOAD="/lib/libtsocks.so"
> $ tsocks firefox
> 
> or tsocks kmail, or tsocks <anything else>.
> 
> The connection is not sent out via the server on 10.10.10.12.  The
> terminal that ran tsocks does not reveal anything in terms of a
> connection taking place, at least not when I run firefox.  With
> Chromium things are more revealing:
> 
> $ . tsocks on
> $ tsocks sh
> LD_PRELOAD="/lib/libtsocks.so"
> $ tsocks chromium
> [4591:4604:405018909:ERROR:object_proxy.cc(239)] Failed to call
> method: org.freedesktop.DBus.Error.ServiceUnknown: The name
> org.freedesktop.NetworkManager was not provided by any .service files
> ERROR: ld.so: object '/lib/libtsocks.so' from LD_PRELOAD cannot be
> preloaded: ignored.
> 
> 
> Exporting like this, also fails to load it for chromium:
> 
> $ export LD_PRELOAD=/lib/libtsocks.so
> $ tsocks sh
> LD_PRELOAD="/lib/libtsocks.so"
> $ tsocks chromium
> [5052:5065:973215173:ERROR:object_proxy.cc(239)] Failed to call
> method: org.freedesktop.DBus.Error.ServiceUnknown: The name
> org.freedesktop.NetworkManager was not provided by any .service files
> ERROR: ld.so: object '/lib/libtsocks.so' from LD_PRELOAD cannot be
> preloaded: ignored.
> 
> 
> 
> If I set up socks within the firefox application Advanced/Network
> settings, without using tsocks, the connection succeeds through the
> ssh tunnel.  Therefore I am confident that the tunnel itself is
> working as a socks5 server.
> 
> 
> This is what I have in /etc/socks/tsocks.conf
> 
> server = 127.0.0.1
> server_type = 5
> server_port = 12465
> 
> Similarly, I get no connection if I use proxychains.
> 
> Any idea what I am doing wrong here?
> 



-- 
Alan McKinnnon
alan.mckinnon@gmail.com




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Socks-ifying an application
  2012-05-15 14:45 ` Alan McKinnon
@ 2012-05-15 15:57   ` Mick
  2012-05-15 21:08     ` Alan McKinnon
  0 siblings, 1 reply; 6+ messages in thread
From: Mick @ 2012-05-15 15:57 UTC (permalink / raw
  To: gentoo-user

On 15 May 2012 15:45, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> On Tue, 15 May 2012 10:50:43 +0100
> Mick <michaelkintzios@gmail.com> wrote:

>> $ ssh -D localhost:12465 root@10.10.10.12
>
> This part is fine.
>
> I tried the next part. It didn't work nicely for me.

Ah, thanks for this!  It's reassuring to know that it's not just my system.  :-)


> So what I do now is:
>
> Firefox + FoxyProxy

Firefox is less of a problem for me because I can set it up to
socksify everything.  It is Kmail that I am mostly interested in.


> I see recent KDE now also supports socks. This is a nice new addition
> so konqueror can also use it.

Yes, but it does not work with the current stable kmail.  The new
KDEPIM is such a nightmare I do not plan moving to it anytime soon.
It screwed up one box that I tried it on and that's enough for me.
:-(

Did you have any success with proxychains?

I am not sure if the problem is related to the tsocks LD_PRELOAD error.


I also noticed that when I try to set up a proxy server in Chromium
using the 'under the bonnet' tab, I get this:

"When running Chromium under a supported desktop environment, the
system proxy settings will be used. However, either your system is not
supported or there was a problem while launching your system
configuration.

But you can still configure via the command line. Please see man
chromium-browser for more information on flags and environment
variables."

Trying the command line did not fix it:

[4742:4753:1575546819:ERROR:object_proxy.cc(239)] Failed to call
method: org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.NetworkManager was not provided by any .service files

That's what made me think that something on my system is not set up
properly.  :-/


These are the libtsocks.so files in my system:

# ls -la /lib*/libtsocks.so
lrwxrwxrwx 1 root root 14 May 13 15:34 /lib/libtsocks.so -> libtsocks.so.1
lrwxrwxrwx 1 root root 14 May 13 15:34 /lib64/libtsocks.so -> libtsocks.so.1

# ls -la /lib/libtsocks.so*
lrwxrwxrwx 1 root root    14 May 13 15:34 /lib/libtsocks.so -> libtsocks.so.1
lrwxrwxrwx 1 root root    16 May 13 15:34 /lib/libtsocks.so.1 ->
libtsocks.so.1.8
-rwxr-xr-x 1 root root 42912 May 13 15:34 /lib/libtsocks.so.1.8

# ls -la /lib64/libtsocks.so*
lrwxrwxrwx 1 root root    14 May 13 15:34 /lib64/libtsocks.so -> libtsocks.so.1
lrwxrwxrwx 1 root root    16 May 13 15:34 /lib64/libtsocks.so.1 ->
libtsocks.so.1.8
-rwxr-xr-x 1 root root 42912 May 13 15:34 /lib64/libtsocks.so.1.8

I can't see why it would not load it, unless it should be trying to
load the '/lib64/libtsocks.so' instead of the '/lib/libtsocks.so' on
an amd64 system?  Shall I file a bug?
-- 
Regards,
Mick



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Socks-ifying an application
  2012-05-15 15:57   ` Mick
@ 2012-05-15 21:08     ` Alan McKinnon
  2012-05-15 22:19       ` Mick
  0 siblings, 1 reply; 6+ messages in thread
From: Alan McKinnon @ 2012-05-15 21:08 UTC (permalink / raw
  To: gentoo-user; +Cc: michaelkintzios

On Tue, 15 May 2012 16:57:26 +0100
Mick <michaelkintzios@gmail.com> wrote:

> On 15 May 2012 15:45, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> > On Tue, 15 May 2012 10:50:43 +0100
> > Mick <michaelkintzios@gmail.com> wrote:
> 
> >> $ ssh -D localhost:12465 root@10.10.10.12
> >
> > This part is fine.
> >
> > I tried the next part. It didn't work nicely for me.
> 
> Ah, thanks for this!  It's reassuring to know that it's not just my
> system.  :-)
> 
> 
> > So what I do now is:
> >
> > Firefox + FoxyProxy
> 
> Firefox is less of a problem for me because I can set it up to
> socksify everything.  It is Kmail that I am mostly interested in.
> 
> 
> > I see recent KDE now also supports socks. This is a nice new
> > addition so konqueror can also use it.
> 
> Yes, but it does not work with the current stable kmail.  The new
> KDEPIM is such a nightmare I do not plan moving to it anytime soon.
> It screwed up one box that I tried it on and that's enough for me.
> :-(
> 
> Did you have any success with proxychains?
> 
> I am not sure if the problem is related to the tsocks LD_PRELOAD
> error.

It almost certainly is, tsocks uses LD_PRELOAD to mangle it's magic so
that stuff works. I believe chromium has severe issues with tsocks
because of how it does it's sandboxing, but I honestly don't know how
to get around that.

On a properly setup Gentoo amd64 system, /lib is a link to /lib64, so
the error you get is not a path error, the chromium binary really
cannot (or will not) deal with tsocks.so

I don't see anything wrong with the rest of your config. I honestly
think you are dealing with a chromium feature not a chromium bug.

Have you searched chromium-specific sites to see what others have to
say?



> 
> 
> I also noticed that when I try to set up a proxy server in Chromium
> using the 'under the bonnet' tab, I get this:
> 
> "When running Chromium under a supported desktop environment, the
> system proxy settings will be used. However, either your system is not
> supported or there was a problem while launching your system
> configuration.
> 
> But you can still configure via the command line. Please see man
> chromium-browser for more information on flags and environment
> variables."
> 
> Trying the command line did not fix it:
> 
> [4742:4753:1575546819:ERROR:object_proxy.cc(239)] Failed to call
> method: org.freedesktop.DBus.Error.ServiceUnknown: The name
> org.freedesktop.NetworkManager was not provided by any .service files
> 
> That's what made me think that something on my system is not set up
> properly.  :-/
> 
> 
> These are the libtsocks.so files in my system:
> 
> # ls -la /lib*/libtsocks.so
> lrwxrwxrwx 1 root root 14 May 13 15:34 /lib/libtsocks.so ->
> libtsocks.so.1 lrwxrwxrwx 1 root root 14 May 13
> 15:34 /lib64/libtsocks.so -> libtsocks.so.1
> 
> # ls -la /lib/libtsocks.so*
> lrwxrwxrwx 1 root root    14 May 13 15:34 /lib/libtsocks.so ->
> libtsocks.so.1 lrwxrwxrwx 1 root root    16 May 13
> 15:34 /lib/libtsocks.so.1 -> libtsocks.so.1.8
> -rwxr-xr-x 1 root root 42912 May 13 15:34 /lib/libtsocks.so.1.8
> 
> # ls -la /lib64/libtsocks.so*
> lrwxrwxrwx 1 root root    14 May 13 15:34 /lib64/libtsocks.so ->
> libtsocks.so.1 lrwxrwxrwx 1 root root    16 May 13
> 15:34 /lib64/libtsocks.so.1 -> libtsocks.so.1.8
> -rwxr-xr-x 1 root root 42912 May 13 15:34 /lib64/libtsocks.so.1.8
> 
> I can't see why it would not load it, unless it should be trying to
> load the '/lib64/libtsocks.so' instead of the '/lib/libtsocks.so' on
> an amd64 system?  Shall I file a bug?



-- 
Alan McKinnnon
alan.mckinnon@gmail.com




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Socks-ifying an application
  2012-05-15 21:08     ` Alan McKinnon
@ 2012-05-15 22:19       ` Mick
  2012-05-16 10:01         ` Mick
  0 siblings, 1 reply; 6+ messages in thread
From: Mick @ 2012-05-15 22:19 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 1365 bytes --]

On Tuesday 15 May 2012 22:08:17 you wrote:
> On Tue, 15 May 2012 16:57:26 +0100
> Mick <michaelkintzios@gmail.com> wrote:
 
> > I am not sure if the problem is related to the tsocks LD_PRELOAD
> > error.
> 
> It almost certainly is, tsocks uses LD_PRELOAD to mangle it's magic so
> that stuff works. I believe chromium has severe issues with tsocks
> because of how it does it's sandboxing, but I honestly don't know how
> to get around that.
> 
> On a properly setup Gentoo amd64 system, /lib is a link to /lib64, so
> the error you get is not a path error, the chromium binary really
> cannot (or will not) deal with tsocks.so
> 
> I don't see anything wrong with the rest of your config. I honestly
> think you are dealing with a chromium feature not a chromium bug.
> 
> Have you searched chromium-specific sites to see what others have to
> say?

I haven't yet, because it is not just Chromium that's not working as it is 
supposed to (although it is the most vocal app on the terminal when called 
with tsocks).  I haven't yet found an app which will work with tsocks at all.

The fact that proxychains does not work at all (applications completely ignore 
it and run outside the tunnel) made me question the sanity of my set up.  Is 
there anything other than coincidence that would cause both apps to fail?
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Socks-ifying an application
  2012-05-15 22:19       ` Mick
@ 2012-05-16 10:01         ` Mick
  0 siblings, 0 replies; 6+ messages in thread
From: Mick @ 2012-05-16 10:01 UTC (permalink / raw
  To: gentoo-user

On 15 May 2012 23:19, Mick <michaelkintzios@gmail.com> wrote:
> On Tuesday 15 May 2012 22:08:17 you wrote:

>> I don't see anything wrong with the rest of your config. I honestly
>> think you are dealing with a chromium feature not a chromium bug.
>>
>> Have you searched chromium-specific sites to see what others have to
>> say?
>
> I haven't yet, because it is not just Chromium that's not working as it is
> supposed to (although it is the most vocal app on the terminal when called
> with tsocks).  I haven't yet found an app which will work with tsocks at all.

OK, I just noticed that launching chromium from a terminal brings up
this error, so it is not tsocks specific:

$ chromium
[4163:4174:213397467:ERROR:object_proxy.cc(239)] Failed to call
method: org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.NetworkManager was not provided by any .service files


> The fact that proxychains does not work at all (applications completely ignore
> it and run outside the tunnel) made me question the sanity of my set up.  Is
> there anything other than coincidence that would cause both apps to fail?

Yep, it is a coincidence it seems:

  https://bugs.gentoo.org/show_bug.cgi?id=408427

-- 
Regards,
Mick



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-16 10:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-15  9:50 [gentoo-user] Socks-ifying an application Mick
2012-05-15 14:45 ` Alan McKinnon
2012-05-15 15:57   ` Mick
2012-05-15 21:08     ` Alan McKinnon
2012-05-15 22:19       ` Mick
2012-05-16 10:01         ` Mick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox