The user named usr needs to execute program /home/usr/prog as root. But, nobody but root must be able to delete/modify program /home/usr/prog. How to do it?
My attemption was
# chown root /home/usr/prog
# chmod 0 /home/usr/prog
# chmod u+x /home/usr/prog
At end of the /etc/sudoers file I added the line
usr<TAB>ALL=(root) NOPASSWD: /home/usr/prog
Ofcourse, tabulator is instead of <TAB>. Then, the line
$ sudo /home/usr/prog
works fine, but the user usr is able to overwrite/delete program /home/usr/prog.
My attemption was
# chown root /home/usr/prog
# chmod 0 /home/usr/prog
# chmod u+x /home/usr/prog
At end of the /etc/sudoers file I added the line
usr<TAB>ALL=(root) NOPASSWD: /home/usr/prog
Ofcourse, tabulator is instead of <TAB>. Then, the line
$ sudo /home/usr/prog
works fine, but the user usr is able to overwrite/delete program /home/usr/prog.