sudo vs. gksu

Markus Schönhaber ubuntu-users at list-post.mks-mail.de
Sat Apr 5 15:36:08 UTC 2008


Tony Arnold wrote:

> Nils Kassube wrote:

>> With sudo some applications access / modify the user's config files as 
>> root. From then on they are owned by root and the user can no longer 
>> access / modify them. That leads to unusual error messages which only 
>> long time users can trace back to the permission problem. With gksu (or 
>> kdesu if you use kde) this problem is avoided.
> 
> Can you explain how this problem is avoided with gksu, or gksudo? So far
> as I can see using one of these causes the application to run with UID
> of 0, i.e., root. The app has no knowledge of how it was invoked, so any
> files is creates will be owned by root.

AFAICS gksudo changes HOME to /root (or to the home directory of the
user it executes the command under). So, the files created will, in
fact, be owned by root. But if those files are created in $HOME they are
created in ~ of the user changed to, not in ~ of the user issuing gksudo.
Maybe, the same effect could be achieved by using sudo -H instead of gksudo.

> Your explanation applies to running any app, not just graphical ones.

Indeed. But as I understand it, it's the graphical apps which are
considered most likely to cause problems for the average user.

Regards
  mks




More information about the ubuntu-users mailing list