LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-12-2018, 08:06 AM   #16
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 280

Original Poster
Rep: Reputation: Disabled

Hi hydrurga,

thank you so much for your help.

Alas the readme-file gives no hint as to un-installation.
Here´s the complete readme-file:
Quote:
[![Build Status](https://travis-ci.org/dgoulet/torsoc...oulet/torsocks)

What is torsocks?
-----------------

Torsocks allows you to use most applications in a safe way with Tor. It ensures
that DNS requests are handled safely and explicitly rejects any traffic other
than TCP from the application you're using.

Torsocks is an ELF shared library that is loaded before all others. The library
overrides every needed Internet communication libc function calls such as
connect(2) or gethostbyname(3).

This process is transparent to the user and if torsocks detects any
communication that can't go through the Tor network such as UDP traffic, for
instance, the connection is denied. If, for any reason, there is no way for
torsocks to provide the Tor anonymity guarantee to your application, torsocks
will force the application to quit and stop everything.

Requirements
-----------------

- autoconf
- automake
- libtool
- gcc

Installation
-----------------

$ ./configure
$ make
$ sudo make install

If you are compiling it from the git repository, run ./autogen.sh before the
configure script.

Using torsocks
--------------

Once you have installed torsocks, just launch it like so:

$ torsocks [application]

So, for example you can use ssh to a some.ssh.com by doing:

$ torsocks ssh username@some.ssh.com

You can use the torsocks library without the script provided:

$ LD_PRELOAD=/full/path/to/libtorsocks.so your_app

For more details, please see the torsocks.1, torsocks.8 and torsocks.conf.5 man
pages. Also, you can use -h, --help for all the possible options of the
torsocks script.

A configuration file named *torsocks.conf* is also provided for the user to
control some parameters.

More informations
--------------

torsocks is distributed under the GNU General Public License version 2.

Mailing list for help is <tor-talk@lists.torproject.org> and for development
use <tor-dev@lists.torproject.org>. You can find the project also on IRC server
irc.oftc.net (OFTC) in #tor and #tor-dev.

See more information about the Tor project at https://www.torproject.org.
 
Old 06-12-2018, 08:18 AM   #17
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 280

Original Poster
Rep: Reputation: Disabled
I just rebooted my system.... just in case.
But that didn´t change anything.

Still: APT::Install-Recommends "true";
 
Old 06-12-2018, 08:23 AM   #18
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
I just downloaded the source code from the place you got it and the file "INSTALL" in the root directory contains a great deal more information on the installation procedure.

It suggests that make uninstall might do the trick (run this from the source code directory you created to build the application).
 
1 members found this post helpful.
Old 06-12-2018, 08:39 AM   #19
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 280

Original Poster
Rep: Reputation: Disabled
Hi and tnx.

It really didn´t occur to me to look elswhere than the readme-file.

Anyway, I un-installed torsocks with make uninstall running the command from the respective directory.
It seems to have worked as the command torsocks isn´t available any more.

Yet two entries remain:

/usr/local/lib/torsocks
/usr/local/share/doc/torsocks


But they are empty.

So: success.
 
Old 06-12-2018, 08:45 AM   #20
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Excellent. Right, I've figured out the Recommends issue. It turns out that 99synaptic contains an option to turn Install-Recommends on, and as 01norecommend comes before it alphanumerically, 99synaptic wins the day.

So the amended instructions are:

Code:
sudo su

cat > /etc/apt/apt.conf.d/99znorecommend << EOF
APT::Install-Recommends "0";
EOF

exit
Test it afterwards in the customary way.
 
Old 06-12-2018, 08:52 AM   #21
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 280

Original Poster
Rep: Reputation: Disabled
Tnx for figuring out that one.

But exactly what should I do about the
Code:
-rw-r--r-- 1 root root   29 Jun 12 14:40 01norecommend
that we´ve ceated? Should it be deleted before performing
Code:
sudo su

cat > /etc/apt/apt.conf.d/99znorecommend << EOF
APT::Install-Recommends "0";
EOF

exit
?
 
Old 06-12-2018, 08:56 AM   #22
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Housekeeping on the move - I like it. Although it will have no effect on the situation, given 99synaptic, you're right to clean up and delete it. You can do this with:

Code:
sudo rm /etc/apt/apt.conf.d/01norecommend

Last edited by hydrurga; 06-12-2018 at 08:57 AM.
 
Old 06-12-2018, 09:10 AM   #23
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
I'm off out for a while, so I recommend that you now install torsocks from the repo and see if it works any better than the manually installed one did.

Note that although you have now switched off Install-Recommends globally, if when installing a package and seeing the information that apt provides before it actually installs it, you decide that you want to auto install the recommended packages for that package, you can use the --install-recommends option in apt-get.
 
Old 06-12-2018, 09:11 AM   #24
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 280

Original Poster
Rep: Reputation: Disabled
Great success again.
I did everything as described and now:
Code:
rosika@rosika-Lenovo-H520e ~> apt-config dump | grep Recommends
APT::Install-Recommends "0";
Tnx so much!
And now apt-get -s install torsocks gives me
Code:
apt-get -s install torsocks
HINWEIS: Dies ist nur eine Simulation!
         apt-get benötigt root-Privilegien für die reale Ausführung.
         Behalten Sie ebenfalls in Hinterkopf, dass die Sperren deaktiviert
         sind, verlassen Sie sich also bezüglich des reellen aktuellen
         Status der Sperre nicht darauf!
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
  linux-headers-4.4.0-124 linux-headers-4.4.0-124-generic
  linux-image-4.4.0-124-generic linux-image-extra-4.4.0-124-generic open-vm-tools-dkms
Verwenden Sie »apt autoremove«, um sie zu entfernen.
Empfohlene Pakete:
  tor
Die folgenden NEUEN Pakete werden installiert:
  torsocks
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Inst torsocks (2.1.0-2 Ubuntu:16.04/xenial [amd64])
Conf torsocks (2.1.0-2 Ubuntu:16.04/xenial [amd64])
Now I try to install torsocks via apt.
As soon as I can say more about it I´ll post.

In the meantime: a great thank-you for your help.

Last edited by Rosika; 06-12-2018 at 09:13 AM.
 
Old 06-12-2018, 09:12 AM   #25
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Yes, go ahead.
 
Old 06-12-2018, 09:58 AM   #26
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 280

Original Poster
Rep: Reputation: Disabled
@ all:

Hi again,

Installation went fine.

But alas: torsocks is not working as expected.
torsocks rhythmbox for example starts rhythmbox. But again: no internet-connection can be established.


Code:
(rhythmbox:13621): Rhythmbox-WARNING **: Unable to grab media player keys: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SettingsDaemon was not provided by any .service files
[Jun 12 16:48:05] PERROR torsocks[13621]: socks5 libc connect: Verbindungsaufbau abgelehnt (in socks5_connect() at socks5.c:185)
----- connection refused -----
The problem with firefox also remains the same (see post #1).

What does work is torsocks --shell ("Create a new shell with LD_PRELOAD including torsocks(8).")
But I can´t see any good use in that.

Seems nothing more can be done about it. It´s a real shame - after all the work that went into making it run.
Nevertheless:
Thank you so much for yor help and all the effort of yours, hydrurga!

Greetings
Rosika

@ Turbocapitalist:

Thanks a lot for your help, too.
 
Old 06-12-2018, 10:53 AM   #27
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 280

Original Poster
Rep: Reputation: Disabled
*****UPDATE*****

After doing a bit of research I found some additional info as to the fault: https://www.tuicool.com/articles/EJJrmmy

The user got this info:

Code:
root@kali:~# torsocks curl icanhazip.com
[Dec 28 20:20:26] PERROR torsocks[2979]: socks5 libc connect: Connection refused (in socks5_connect() at socks5.c:185)
curl: (6) Could not resolve host: icanhazip.com
root@kali:~#
, which is precisely the same error-message I got.

It goes on like this:

Opps, that just means I forgot to start tor service. Start tor application using the following command:
Code:
root@kali:~# service tor start
root@kali:~#
Now try again:
Code:
root@kali:~# torsocks curl icanhazip.com
197.231.221.211
root@kali:~#
That´s it. That´s what I cannot do. There is no tor.service with me.
Seems that tor.service is automatically installed when installing tor itself.

But as torsocks doesn´t require tor to be installed (see apt show torsocks) I´m out of my wits......
 
Old 06-12-2018, 12:04 PM   #28
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Is the following any use? It refers to the Tor port.

https://askubuntu.com/questions/8746...google_rich_qa
 
Old 06-12-2018, 12:09 PM   #29
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
So that I can understand, you say that you have tor-browser-bundle on a stick. Are you planning on putting torsocks on the stick as well, or is it for your main machine? If the latter, why don't you want to install Tor on your main machine? (it shouldn't affect the copy of tor on your stick).

P.S. Don't get out of your wits, or give up. This is a good learning experience (for us both, since I'm not used to using Tor on Linux).

Last edited by hydrurga; 06-12-2018 at 12:10 PM.
 
Old 06-13-2018, 04:34 AM   #30
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 280

Original Poster
Rep: Reputation: Disabled
Hi again hydrurga,

your´re most kind. Thanks for your help.

As far as your link is concerned the user says:
Quote:
I want to Tor in terminal. This is what I used to do and it was working without any issue:

running Tor Browser
running torify or torsocks before the command in terminal
It seeems that he has Tor-Browser or Tor-Browser-Bundle (or whatever) locally installed on his system.
Otherwise torify wouldn´t work as this seems to be an integral part of Tor.
So there´s the difference.

In the meantime I´m convinced that Tor has to be locally installed in order to get torsocks to work. (see https://www.tuicool.com/articles/EJJrmmy)

tor.service
has to be available, I think.

Quote:
you say that you have tor-browser-bundle on a stick. Are you planning on putting torsocks on the stick as well, or is it for your main machine?
Well, I have made it my policy to install as few programms as possible on my local machine (the traditional way). So any "portable" programmes are welcome.
Plus ubutuusers.de states
Quote:
Das Tor-Browser-Bundle {en} (TBB) ist die Variante, die von den Tor-Entwicklern empfohlen wird (Gründe . Das Tor-Browser-Bundle ist ein in sich stimmiges, geschlossenes Programmpaket mit den Elementen
.

That basically means that Tor-Browser-Bundle (Webdownload) is recommended by the Tor-developers themselves.
For reasons see https://www.torproject.org/projects/torbrowser/design/.
So I thought why bother to install it locally?

In fact I don´t have tor-browser on a stick but on my system:
I start it like this:

Code:
firejail --private=/home/rosika/Schreibtisch/Dokumente/work/tor-browser_de ./start-tor-browser.desktop
(Yeah, I sandbox almost everything....)
Therefore I didn´t intend to install Tor/Tor-browser locally.
The thing is don´t see a way to get torsocks to work alongside my "portable installation".
Reason: no tor.service running.

So that´s my current situation.

Greetings.
Rosika
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] I using the torsocks with curl. P.G.Krish Linux - Security 4 07-11-2016 12:16 AM
Hibernate not working properly. hack3rcon Linux - Software 5 02-25-2016 03:35 AM
Using Torsocks to hide the i.p. address question(s) Michael Piziak Linux - Software 8 02-14-2016 01:20 PM
dhcpd not working properly bwarsh Linux - Networking 1 08-15-2005 04:24 PM
X not working properly. MylesCLin Linux - Software 1 09-15-2004 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration