I have a program in Debian which needs root privileges and myuser has to run it, but I have to do the call from a .NET application (C#) running in mono. In /etc/sudoers, I have add the line:
myuser ALL = NOPASSWD: /myprogram
so sudo ./myprogram
works for myuser.
In. NET I use in my code
string fileName = "/myprogram";
ProcessStartInfo info = new ProcessStartInfo (fileName);
...
How can I do the call "sudo fileName"? It doesn't work by the time... thank you, Monique.
RedirectStandardOutput = true
doesn't work with Jariq's answer. – Paintbrush