Article 5AP8C running programs as user but with root privileges

running programs as user but with root privileges

by
terence
from LinuxQuestions.org on (#5AP8C)
This is a question more out of curiosity than a need to solve a specific problem.

I'm wondering if there is a way to run an executable as an ordinary user but wuth root privileges. As far as I can understand, neither sudo, setuid, pkexec or something similar would work, as they all allow users to run things as root. For example, if I sudo something and in the process create a file, that file would belong to root rather than myself. What I'd like to do is run something as myself but with root privileges, so if I create a file, the file belongs to me but having root privileges would allow me to, say, save the file to a directory where I don't normally have write permission.

Maybe there is no way to do this but if there is, I'd like to know how.

Thanks in advance for any advice.
Terencelatest?d=yIl2AUoC8zA latest?i=5us8uZbmo80:baeeT2eKYmY:F7zBnMy latest?i=5us8uZbmo80:baeeT2eKYmY:V_sGLiP latest?d=qj6IDK7rITs latest?i=5us8uZbmo80:baeeT2eKYmY:gIN9vFw5us8uZbmo80
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments