Shell confusion
Bill Davidsen
davidsen at tmr.com
Fri Mar 13 23:05:32 UTC 2009
Mikkel L. Ellertson wrote:
> Matthew Flaschen wrote:
>> You should not run GUI apps under a root shell. Do:
>>
>> sudo gedit
>>
> What is the difference between running "su - -c gedit" and "sudo
> gedit" - they both run gedit as with root permissions. The only
> difference I know about is that the first form runs with root's
> environment. (Like the -i option of sudo.) I would expect this to be
> marginally safer, as you know you are using root's path.
>
Just so. using the "-" causes execution of the initialization done at login as
the shell starts. This can include .bashrc, .bash_profile, etc, etc. The the
bash man page for the exact precedence of that stuff.
>> or better yet:
>>
>> sudoedit /etc/the_config.ext
>>
> This is much safer, and you can still use gedit as your editor if
> you want by setting the VISUAL or EDITOR environment variables.
>
> Mikkel
>
--
Bill Davidsen <davidsen at tmr.com>
"We have more to fear from the bungling of the incompetent than from
the machinations of the wicked." - from Slashdot
More information about the fedora-list
mailing list