-
Notifications
You must be signed in to change notification settings - Fork 11
Description
So, this isn't an issue but more of a modification.
Whenever I used tornet, it asked for password for authentication. It won't work with sudo command either
So, I came up with this so we don't have to authenticate it each and every time it reloads the tor service:-
Step 1:
Run command sudo visudo -f /etc/sudoers.d/tor-nopasswd
Step 2:
Copy paste the line and write your username
YOUR_USERNAME ALL=(ALL) NOPASSWD: /usr/bin/systemctl start tor.service, /usr/bin/systemctl stop tor.service, /usr/bin/systemctl restart tor.service, /usr/bin/systemctl reload tor.service, /usr/bin/systemctl start tor@default.service, /usr/bin/systemctl stop tor@default.service, /usr/bin/systemctl restart tor@default.service, /usr/bin/systemctl reload tor@default.service
Step 3:
Save the file
Step 4:
Check with command "pip show tornet"
Step 5:
Copy the location path from output of Step 4, and go to that dir using cd LOCATION_PATH
Step 6:
Once in that directory, do "cd tornet"
Step 7:
Open tornet.py file using nano
nano tornet.py
Step 8:
Replace following lines
- os.system("service tor start") -----------> os.system("sudo -n /usr/bin/systemctl start tor.service")
- os.system("service tor reload") -----------> os.system("sudo -n /usr/bin/systemctl reload tor.service")
Step 9:
Save and exit
Now, when we run the tornet commands we are not asked for authentication