3

I found an article http://superuser.com/questions/611511/how-to-launch-sshuttle-without-superuser-pwd-prompt, but when I try ps auxwww |grep sud, I get different output:

root      2846  0.0  0.1  79104  4328 pts/0    S+   08:27   0:00 sudo -p [local sudo] Password:  PYTHONPATH=/usr/lib/python3/dist-packages -- /usr/bin/python3 /usr/bin/sshuttle --method auto --firewall

So I tried to replace

/usr/bin/python /usr/share/sshuttle/main.py /usr/bin/python -v --firewall 12300 0

with my case:

PYTHONPATH=/usr/lib/python3/dist-packages -- /usr/bin/python3 /usr/bin/sshuttle --method auto --firewall

When I finished editing,visudo says my grammar is wrong; what's my mistake and how to get the things done?

5
  • It would be easier to see what is wrong if you showed the entire line you're trying to put into your sudo configuration and that visudo is unhappy about. My guess would be that you should not include the setting of PYTHONPATH. Commented Jul 22, 2019 at 15:02
  • I add this two lines to the end of my sudo configuration Cmnd_Alias SSHUTTLE = /usr/bin/python3 /usr/bin/sshuttle --method auto --firewall iucmr ALL=(root) NOPASSWD: SSHUTTLE Commented Jul 23, 2019 at 10:45
  • Then error when I run sshuttle iucmr@ricn:~$ sshuttle -r [email protected] 0/0 --dns -x 111.111.111.111 --python '/usr/bin/python3.6' 'sudo: sorry, you are not allowed to set the following environment variables: PYTHONPATH fatal: ['sudo', '-p', '[local sudo] Password: ', 'PYTHONPATH=/usr/lib/python3/dist-packages', '--', '/usr/bin/python3', '/usr/bin/sshuttle', '--method', 'auto', '--firewall'] returned 1 Commented Jul 23, 2019 at 10:49
  • Then error when I run sshuttle iucmr@ricn:~$ sshuttle -r [email protected] 0/0 --dns -x 111.111.111.111 --python '/usr/bin/python3.6' Commented Jul 23, 2019 at 10:56
  • sudo: sorry, you are not allowed to set the following environment variables: PYTHONPATH fatal: ['sudo', '-p', '[local sudo] Password: ', 'PYTHONPATH=/usr/lib/python3/dist-packages', '--', '/usr/bin/python3', '/usr/bin/sshuttle', '--method', 'auto', '--firewall'] returned 1 Commented Jul 23, 2019 at 10:56

1 Answer 1

1

Thats it...

# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Defaults        env_keep += PYTHONPATH

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias SSHUTTLE =  /usr/bin/python3 , /usr/bin/sshuttle --method auto --firewall

# User privilege specification
root    ALL=(ALL:ALL) ALL
your_username    ALL=(ALL) NOPASSWD: SSHUTTLE

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
5
  • Isn't #includedir /etc/sudoers.dde here a syntax error? What's the intention of that line? Commented Aug 14, 2019 at 13:46
  • Actually, it's not a comment; #includedir is a valid directive "used to create a sudoers.d directory that the system package manager can drop sudoers rules into as part of package installation" Commented Aug 14, 2019 at 13:52
  • Since you've addressed the sshuttle question with the previous lines, I would suggest removing the last 3 lines altogether. (and perhaps even the last 5 lines) Commented Aug 14, 2019 at 13:53
  • Isn't #includedir /etc/sudoers.dde here a syntax error? YES. Editing. Commented Aug 14, 2019 at 14:03
  • I feel like this post would be better if it focused on answering the question by removing the %sudo section onwards. It doesn't even need the root line. Commented Aug 14, 2019 at 14:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.