Sure. This may be executed. You would wish to repeat it to a vacation spot that you’ve got permission to write down to and ensure it’s in your PATH and the right permissions assigned to it.
This being stated it’s not beneficial. Usually it’s simpler to simply set up a binary with the standard strategies so will probably be put in with dependencies and or within the appropriate PATH with appropriate permissions and many others.
I simply tried this on two macs. I moved cron from /usr/sbin to a different mac on the desktop. It is not going to permit shifting it to /usr/sbin on the opposite mac as a result of macOS wont permit it. Whereas technically I can execute this program, it’s simply not within the appropriate PATH. There have been no safety alerts or quarantine points.
Terminal command:
scp /path/to/supply/binary consumer@destination-mac:/Customers/consumer/Desktop/
On vacation spot mac:
sudo chmod +x binary
I then outlined the brand new PATH:
PATH=/Customers/consumer/Desktop/
I then tried to execute the file:
sudo /Customers/consumer/Desktop/binary
Output:
zsh: killed /Customers/consumer/Desktop/binary
So you may see that whereas it may be executed, it’s not actually a beneficial methodology.