12 ms·
The other way to do it is to change ownership of the executable to nobody:nogroup and set the setuid/setgid bits. Perhaps you could simply put those chown/chmo
by curun1r 8y ago
The other way to do it is to change ownership of the executable to nobody:nogroup and set the setuid/setgid bits.
Perhaps you could simply put those chown/chmod commands in the docs:
sudo chown nobody:nogroup path_to_up
sudo chmod ug+s path_to_up
I've tested it, and it seems to prevent deleting files with rm. What doesn't work, however, is that it also prevents writing the results to up1.sh. Perhaps if writing to the file fails (or you detect the process is running as nobody), you could send the finished pipe sequence to stdout instead of a shell script. Then, people could run it like:
cmd | up > up1.sh
- laumars 8y agoThe solution there is not to set any writable bits for the up executable. Then only root will be able to write to it (which is ideally what you want for any tools within /usr/bin (whatever) anyway