3

How do I elevate privileges programmatically under Linux environment when I spawn a Process? For Windows console applications, it can be done by setting startInfo.Verb = "runas"; according to this post. However, that does not work under Linux environment.

For example, I want to have a Process that can create, delete, edit, move to, move from, etc, in the root directory. How can I elevate the privilege so all subsequent process call and not require the user to input their password?

cli2
  • 239
  • 1
  • 5
  • 12
  • 2
    This is subverting the Linux security system, I'm not sure it is possible. The main process should have been started with `sudo` or `su `. How are you moving the files? Using external processes or `File.Copy`? – Ron Beyer Sep 10 '18 at 17:54
  • @RonBeyer I am moving the files with mv command `proc.StartInfo.FileName = cmd` – cli2 Sep 10 '18 at 17:58

0 Answers0