mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-01-31 18:49:15 +01:00
Fix compatibility with the sudoers file
Starting sshuttle without having to type in one's password requires to put the sudo-ed command in the `/etc/sudoers` file. However, sshuttle sets an environment variable, which cannot be done as-is in the sudoers file. This fix prepend the /usr/bin/env command, which allows one to pass fixed environment variables to a sudo-ed command. In practice, the sub-command: ``` sudo PYTHONPATH=/usr/lib/python3/dist-packages -- \ /usr/bin/python3 /usr/bin/sshuttle --method auto --firewall ``` becomes ``` sudo /usr/bin/env PYTHONPATH=/usr/lib/python3/dist-packages \ /usr/bin/python3 /usr/bin/sshuttle --method auto --firewall ```
This commit is contained in:
parent
f27b27b0e8
commit
93b969a049
@ -193,8 +193,8 @@ class FirewallClient:
|
|||||||
if ssyslog._p:
|
if ssyslog._p:
|
||||||
argvbase += ['--syslog']
|
argvbase += ['--syslog']
|
||||||
argv_tries = [
|
argv_tries = [
|
||||||
['sudo', '-p', '[local sudo] Password: ',
|
['sudo', '-p', '[local sudo] Password: ', '/usr/bin/env',
|
||||||
('PYTHONPATH=%s' % python_path), '--'] + argvbase,
|
('PYTHONPATH=%s' % python_path)] + argvbase,
|
||||||
argvbase
|
argvbase
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user