1

I created a Automator Program wich connect me with vpn an sets routes for split tunneling via Shell script.

The Program works fine on Mojave - now with Catalina the call

do shell script "sudo /Users/XXX/Desktop/routen_VPN.sh" with administrator privileges

produces an error

sh: /Users/XXX/Desktop/routen_VPN.sh: Operation not permitted
4
  • Does it work if you run the command directly from Terminal?
    – nohillside
    Commented Sep 25, 2019 at 11:10
  • Yes - works like expected in Terminal. Commented Sep 25, 2019 at 11:21
  • Note that you should not use sudo and with administrator privileges together.
    – red_menace
    Commented Sep 25, 2019 at 13:07
  • No matter if I remove sudo or with administrator privileges - it won't work at all... Commented Sep 25, 2019 at 14:22

3 Answers 3

1

Now I have a solution that works for me. If I put the content of the routen_VPN.sh in Automator in AppleScript like this do shell script "content of routen_VPN.sh" with administrator privileges it works fine. Thanks to all who tried to help me with this! :-)

0

In my case adding the Finder to the apps having full disk access in system prefs > security & confidentiality > confidentiality tab enabled me to run a Python script (without this I was also getting an "Operation not permitted" error).

-1

You've created file routen_VPN.sh with the root user as the owner (because you used sudo), which is why you're not permitted to change the permissions as yourself.

Thus, use sudo chmod u+x routen.sh, but note that that will make the file only executable for the root user.

To make the file executable by everyone, use sudo chmod a+x routen.sh.

4
  • Hi! Thanks for your answer but nothing changed. I've tried both - same error. Commented Sep 25, 2019 at 12:12
  • Have you grant full access for a terminal in Full Disk Access from the Privacy tab under Security & Privacy.
    – Udhy
    Commented Sep 25, 2019 at 13:51
  • Yes full access is granted Commented Sep 25, 2019 at 14:23
  • Not sure I understand you correctly here. Running a script with sudo has nothing to do with file ownership, and sudo chmod u+x routen.sh will make the file executable by the owner, not by root. Also, if the file is already owned by the current user, you don't need sudo to chmod it.
    – nohillside
    Commented Sep 26, 2019 at 8:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .