What's new

Enable Tor Connection via Putty commands / SSH

  • 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!

AppleAssassin

New Around Here
Hey guys,

First time posting on here because no where else on the internet has the answer for this.


Is there a way I can enable and disable the Tor service on the router via an SSH command line? I can connect to the router just fine but I can't find anywhere a command to enable the Tor service.

Any help would be much appreciated!
 
Is there a way I can enable and disable the Tor service on the router via an SSH command line?

/jffs/home/tor-start
Code:
#!/bin/sh
local TOR_CMD="/usr/sbin/Tor -f /jffs/home/torrc"
local TOR_PID=$(/bin/echo $(/bin/ps w | /bin/grep -i "$TOR_CMD" | /bin/grep -v grep) | /usr/bin/cut -f1 -d' ')

if [ -z "$TOR_PID" ]; then
  /usr/bin/killall Tor tor
  /bin/sleep 1
  [ -d /var/lib/tor ] && /bin/rm -rf /var/lib/tor
  [ -d /jffs/tor ] && /bin/cp -a /jffs/tor /var/lib/.
  /bin/mkdir -p /var/log/tor
  /bin/mkdir -p /var/lib/tor
  /bin/mkdir -p /var/lib/tor/hidden_service
  /bin/mkdir -p /var/lib/tor/other_hidden_service
  /bin/chown -R tor:tor /var/log/tor /var/lib/tor
  /bin/chmod -R u=rwx,g-rwx,o-rwx /var/log/tor /var/lib/tor
  $TOR_CMD
fi

/jffs/home/tor-stop
Code:
#!/bin/sh
local TOR_CMD="/usr/sbin/Tor -f /jffs/home/torrc"
local TOR_PID=$(/bin/echo $(/bin/ps w | /bin/grep -i "$TOR_CMD" | /bin/grep -v grep) | /usr/bin/cut -f1 -d' ')

if [ -n "$TOR_PID" ]; then
  /usr/bin/killall Tor tor
  /bin/sleep 1
  source /jffs/home/tor-save
fi

/jffs/home/tor-save
Code:
#!/bin/sh
if [ -d /var/lib/tor ]; then
  if [ -f /entware/bin/rsync ]; then
    /entware/bin/rsync -axvi --checksum --no-W --no-times --inplace --stats --temp-dir=/tmp --log-file=/tmp/rsync.log /var/lib/tor /jffs/
  else
    /bin/cp -a /var/lib/tor /jffs/.
  fi
fi

/jffs/scripts/init-start
Code:
#!/bin/sh
# TODO: fix the passwd, group and shadow filenames to use the real ones
echo "tor:x:111:111:tor:/dev/null:/dev/null" >> /etc/p-a-s-s-w-d
echo "tor:x:111:" >> /etc/g-r-o-u-p
echo "tor::0:0:99999:7:0:0:" >> /etc/s-h-a-d-o-w

Last step is to configure your firewall as a TOR transparent proxy. It's very easy. Details here:
https://www.dd-wrt.com/wiki/index.php/Tor_on_R7000#Transparent_proxy
https://trac.torproject.org/projects/tor/wiki/doc/TransparentProxy

The Asuswrt firmware uses an outdated version of TOR. It's easy enough to upgrade, wtf Asus?
 
Last edited:
Ha! The CloudFlare catched me. So you must fix my init-start script (above) correct the filenames. You know what to do.


"Sorry, you have been blocked
You are unable to access snbforums.com

Why have I been blocked?

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.


What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the CloudFlare Ray ID found at the bottom of this page."
 
Last edited:
Hey guys,

First time posting on here because no where else on the internet has the answer for this.


Is there a way I can enable and disable the Tor service on the router via an SSH command line? I can connect to the router just fine but I can't find anywhere a command to enable the Tor service.

Any help would be much appreciated!

Code:
nvram set Tor_enable=1
nvram commit
service restart_tor

Set it back to 0 to disable.
 
I can start the built-in(internal) TOR with mine a config the file?

I create /opt/etc/init.d/S35tor
Code:
#!/bin/sh
ENABLED=yes
PROCS=tor
ARGS="-f /opt/etc/tor/torrc"
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
. /opt/etc/init.d/rc.func

But it does not work
Code:
 /opt/etc/init.d/S35tor start
 Starting tor...              failed.
I do not want to install the second torcc from Entware repo.
And internal TOR very few settings in a web the interface, only redirect all traffic clients/mac.
 

Similar threads

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