sudo command do not follow /etc/sudoers in BTT

I would like to use sshuttle to create a small VPN that I want to start/stop with a button in BTT.
To start the VPN, I can run the following command in the VPN:
sudo -n sshuttle --dns --daemon --pidfile=/tmp/sshuttle.pid -e "ssh -i /Users/login/.ssh/id_rsa.sshutle" -r login@xxx.xxx.xxx.xxx 0/0

I have set that command in the authorized command without password for sudo and it works nicely. (So far so good)

However if I try to run that command in the "execute shell script" it returns

sudo: a password is required

so it seems that the file /etc/sudoers is not handle correctly from BTT. Is this expected?

1 Like

did you manage to find a solution to that ?

Not really,
I did found some weird work around (open a normal terminal and paste-inside the sudo command to have a proper environment.

I guess I tested to launch via BTT a bash script using the sudo command inside and that it failed, but this would be the first thing I would retry if I would need such sudo command again.

mhm it‘s probably intended by the system that this does not work. You could maybe use apple script with

do shell script "command" with administrator privileges

however that will prompt for a password. You could include the password in the script but that is obviously a bad idea :-/

I think I fixed this by allowing Full Disk Access to BTT from settings and privacy