1

Some time ago I posted a question which was related to whether it is possible to preserve environment variables when sudoing to a different user. As it turned out, this is indeed possible.

When invoking gksudo today to execute a GUI application as the root user, I was expecting that the preservation of environment variables (in my case $HOME) would also work for gksudo as it is configured via the same file, namely /etc/sudoers. As it turned out, this does not seem to be the case.

For example, executing sudo vim will start up an instance of vim, correctly getting the configuration from the invoking user's home folder because I configured sudo to preserve $HOME. But gksudo gvim will fire up a "vanilla" gvim instance.

Is it necessary to separately configure gksudo to achieve what I want?

zepp133
  • 565
  • I think I'm having a similar problem: https://unix.stackexchange.com/questions/378732/etc-sudoers-rule-not-being-obeyed – xendi Jul 15 '17 at 22:54

0 Answers0