What's new

Tor: How can an application access tor's Control Port (default 9051)?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

brec

Regular Contributor
RT-AC86U, 386.3_2

On the VPN::Tor tab, the port fields are Trans (default 9040) and DNS (default 9053).

Tor enabled with those defaults is basically working based on a test using Firefox.

I have an application which accesses tor's Control Port (default 9051), and would like to know if I can use the router's tor instead of one running on my local host.

Edit: the application can't access the Control Port at 9051. I added "ControlPort 192.168.50.1:9051" to /tmp/torrc, but after I enabled/disabled Tor in the GUI the file was rewritten with the original contents.
 
Last edited:
Use a torrc custom config file. Open an ssh session and copy/paste the following into the window. It will automatically create the file. Then restart the tor process (or reboot).

Code:
cat << "EOF" > /jffs/configs/torrc.add
ControlPort 192.168.50.1:9051
EOF

Make sure have "Enable JFFS custom scripts and configs" set to Yes under Administration->System.
 
P.S. I noticed the tor log (/tmp/torlog) refuses to open the port unless you also have some sort of authentication enabled.

Code:
Aug 31 10:45:51.313 [warn] You have a ControlPort set to accept unauthenticated connections from a non-local address.  This means that programs not running on your computer can reconfigure your Tor, without even having to guess a password.  That's so bad that I'm closing your ControlPort for you.  If you need to control your Tor remotely, try enabling authentication and using a tool like stunnel or ssh to encrypt remote access.

The only way it's going to work w/o authentication is if you use localhost (127.0.0.1) and the app that needs access to that port is also running on the router.
 
Last edited:
P.S. I noticed the tor log (/tmp/torlog) refuses to open the port unless you also have some sort of authentication enabled.

Code:
Aug 31 10:45:51.313 [warn] You have a ControlPort set to accept unauthenticated connections from a non-local address.  This means that programs not running on your computer can reconfigure your Tor, without even having to guess a password.  That's so bad that I'm closing your ControlPort for you.  If you need to control your Tor remotely, try enabling authentication and using a tool like stunnel or ssh to encrypt remote access.

The only way it's going to work w/o authentication is if you use localhost (127.0.0.1) and the app that needs access to that port is also running on the router.

OK, thanks. The app is running on a Ubuntu system on the LAN. So I guess it's not going to work. Not a big deal, as tor can run on the Ubuntu system; I just thought it would be nifty to run it on the router.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top