我找到一篇文章http://superuser.com/questions/611511/how-to-launch-sshuttle-without-superuser-pwd-prompt,但是当我尝试时ps auxwww |grep sud
,我得到不同的输出:
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
所以我尝试更换
/usr/bin/python /usr/share/sshuttle/main.py /usr/bin/python -v --firewall 12300 0
就我的情况来说:
PYTHONPATH=/usr/lib/python3/dist-packages -- /usr/bin/python3 /usr/bin/sshuttle --method auto --firewall
当我完成编辑后,visudo 说我的语法错误;我的错误是什么以及如何完成这些事情?
答案1
就是这样...
# 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