Tor stream isolation using torcc

I use torsocks for 3 applications: IRC, SSH and Thunderbird (My Tor browser uses port 9150 fom the torbrowser bundle daemon). I want to use a different tor circuit each application. On the internet I can find a few solutions to make this work but what is safest way using torcc?

I now use the solution below which I got from linux - How to run multiple Tor processes at once with different exit IPs? - Stack Overflow

SocksPort 9052
SocksPort 9053 

According to link above each socks have a different circuit but are the socks isolated in this case? Is it recommended to completely isolate each socks? Do I need to add IsolateDestAddr IsolateDestPort and create streamgroups like here Proposal 171 (revised): Separate streams across circuits by connection metadata with using seperated Trans- and DNSPorts?

I don’t want to mess up and make my tor setup less secure. What is the safest way to configure the socks?

I want to use a different tor circuit each application.

How about using torsocks’s option instead of modifying torrc?

$ torsocks -u for -p irc curl ipinfo.io/ip
185.***.***.210
$ torsocks -u for -p ssh curl ipinfo.io/ip
109.***.***.29
$ torsocks -u for -p mailer curl ipinfo.io/ip
93.***.***.212

$ torsocks -u for -p irc curl ipinfo.io/ip
185.***.***.210
$ torsocks -u for -p ssh curl ipinfo.io/ip
109.***.***.29
$ torsocks -u for -p mailer curl ipinfo.io/ip
93.***.***.212

These did let me use a different tor circuit each curl. You can replace curl with your application.

I’m aware about torsocks and that it force a whole application over tor which many application proxysettings don’t do. But I just want to have options. Some application don’t work properly over Torsocks. What is the best configuration in torrc?

Now I use torcc with different SOCKSPorts. Is that ok or can that cause some identity problems?

What is the best configuration in torrc?

tor manpage says about SocksPort:

If multiple entries of this option are present in your configuration file, Tor will perform stream isolation between listeners by default.

So if I have to modify torrc and use multiple SocksPort entries as you said in order to use a different tor circuit each application, your solution seem to be the best also for me.

Now I use torcc with different SOCKSPorts. Is that ok … ?

I think that is ok.

Note that in my case: However modifying torrc for each application is dangerous because it makes me use the root privilege and reconfigure tor. If I use a different tor circuit each application without torsocks, I use tor’s isolation feature via socks authentication. e.g. for curl:

$ curl --socks5-host 127.0.0.1:9050 -U for:irc ipinfo.io/ip
$ curl --socks5-host 127.0.0.1:9050 -U for:ssh ipinfo.io/ip
...

Most irc and email clients may use socks authentication the same way as curl. openssh can use torsocks.

1 Like

If it can help you :thinking:

archives : wiki.archlinux.org/title/Tor

Have a nice day

cc : @uaooq