On 02/08/2024 20:30, Jeffrey Walton wrote:
On Fri, Aug 2, 2024 at 7:21 AM Greg Wooledge wrote:
On Fri, Aug 02, 2024 at 11:35:58 +0200, Florent Rougon wrote:
Which I am inclined to believe, although I'm reluctant to try 'su -p'
for fear of creating a mess in my normal user setup:

   ~ % su -p
[...]
The main issue here is likely to be the HOME variable.  If you're running
a shell as root, but with HOME=/home/florent or whatever, then some of
the programs you start may create new dot files inside /home/florent/.
These files will be owned by root (because the programs are running as
root).  Then, at some point in the future, if you run those same programs
as florent, you won't be able to change the contents of the dot files.
[...]
emacs is notorious for that. In fact, if you install a new system, and
`sudo emacs <some config file>`, then emacs will create its own config
directory (.emacs/) in your home directory owned by root.

I expect that emacs way to edit system files is TRAMP, something like /sudo:...

In the past I spent some time trying to figure out why bash history did not work. ~/.bash_history owner was root. I prefer "sudo -i" or "su -" since that accident. Sometimes I add --whitelist-environment for specific variables.

Reply via email to