Is there a way to make terminal commands require sudo in macOS Big Sur?
Changing the permissions on the binary is not going to be an effective way of blocking such commands. The user can simply download or copy the osascript
binary from a web site or another computer onto your Mac and run it - without sudo
.
There's probably some resource that you do not want your users to access - and they have been doing that through the osascript
command. But instead of blocking osascript
, look at changing the permissions for that resource. That would in turn make it so that osascript
cannot access it without sudo
.