In one of his responses to the thread "thundebird preferences tab", Bit Twister responded ....
Quote
It is pretty straight forward. "su -" and "su - root" will use root's environment and just su will use whoever issues the "su". As a result
of just su, any files modified/created will be owned by root, not the user. End Quote.
To (poor, undereducated) Me, this implies that if I had three users on
this HP Laptop (say "Daniel", "Junk" and "Test") and I, as "Junk", call
up "su -" or "su - root" (and then enter the root password, I guess),
any system changes I made would be applied to all three users whereas,
if I, as "Junk", call up "su" (and then enter the root password), any
changes I made would *ONLY* be applied to the "Junk" account.
Is my understanding correct??
'Cause it just doesn't seem to make sense to me that the "su" (with no limiting factor) is more limited than either "su -" and/or "su - root".
And that, is where problems are created. For example you edit some file
as "su", any configuration files/directories could become owned by root,
not junk.
On 30/12/20 6:37 pm, Bit Twister wrote:
And that, is where problems are created. For example you edit some file
as "su", any configuration files/directories could become owned by root,
not junk.
I think that I understand this. I usually approach the issue from a
slightly different perspective.
If I am in /home/junk, and run "su -" the prompt changes to a root
prompt in the top level [/].
If on the other hand, I run simply "su", I have a root prompt, but my
place in the directory tree is unchanged. That is what I want if, for example, have a sudden.momentary need to change a file's permissions.
Either way, I have the full powers of the root user, and can change any
file on my system.
If I am logged in as "junk" and want to be logged in as "doug," I run
"su - doug."
Am I right?
The point is, applications use environment variables for the location of directories/files they use/modify. Those user directories/files can become owned by root if "su" is used instead of "su -" or "su - root".
On 31/12/20 11:45 pm, Bit Twister wrote:
The point is, applications use environment variables for the location of
directories/files they use/modify. Those user directories/files can become >> owned by root if "su" is used instead of "su -" or "su - root".
To reinstall VirtualBox, I follow Dave's advice and reinstall the
extension pack as root. He said to use "su -", but recently, I haven't bothered. Usually plain "su means that the current entry in ~/.config/Virtualbox becomes owned by root, and I have to change it back.
Another example is setting up the nVidia driver from XFdrake started
from MCC. There is an option to test the setup. I avoid that, because
if I try, the .Xauthority file in my home directory can become owned by
root, and X won't start as it should.
These sound like examples of what you mean.
On Thu, 31 Dec 2020 23:59:26 +1100, Doug Laidlaw wrote:
On 31/12/20 11:45 pm, Bit Twister wrote:
The point is, applications use environment variables for the location of >>> directories/files they use/modify. Those user directories/files can become >>> owned by root if "su" is used instead of "su -" or "su - root".
To reinstall VirtualBox, I follow Dave's advice and reinstall the
extension pack as root. He said to use "su -", but recently, I haven't
bothered. Usually plain "su means that the current entry in
~/.config/Virtualbox becomes owned by root, and I have to change it back.
Another example is setting up the nVidia driver from XFdrake started
from MCC. There is an option to test the setup. I avoid that, because
if I try, the .Xauthority file in my home directory can become owned by
root, and X won't start as it should.
These sound like examples of what you mean.
Yes, those are good examples.
On 12/31/20 8:13 AM, Bit Twister wrote:
On Thu, 31 Dec 2020 23:59:26 +1100, Doug Laidlaw wrote:Let me try this as an example where I believe things can go horribly wrong:
On 31/12/20 11:45 pm, Bit Twister wrote:
The point is, applications use environment variables for the location of >>>> directories/files they use/modify. Those user directories/files can become
owned by root if "su" is used instead of "su -" or "su - root".
To reinstall VirtualBox, I follow Dave's advice and reinstall the
extension pack as root. He said to use "su -", but recently, I haven't
bothered. Usually plain "su means that the current entry in
~/.config/Virtualbox becomes owned by root, and I have to change it back. >>>
Another example is setting up the nVidia driver from XFdrake started
from MCC. There is an option to test the setup. I avoid that, because
if I try, the .Xauthority file in my home directory can become owned by
root, and X won't start as it should.
These sound like examples of what you mean.
Yes, those are good examples.
Since the OP mentioned Thunderbird, let's talk about that. One of the
things about Thunderbird/Firefox is that they overwrite the
configuration upon closing, saving any changes that were made in the
last session.
If the user was dumb enough to run T-bird as root, then the newly
rewritten config file (I believe it's prefs.js, but don't trust that)
will be owned by root.
If the user had used "su -" or "su - root" then that configuration is
saved in root's home directory, and there's "probably" no harm done.
But, if the user had used "su" then that configuration would be saved in
the user's home directory, now belonging to root, and depending on the permissions, probably can't be changed by the user any more.
Is that more or less correct, Bit?
On 30/12/20 6:37 pm, Bit Twister wrote:
And that, is where problems are created. For example you edit some=20
file as "su", any configuration files/directories could become
owned by root, not junk. =20
I think that I understand this. I usually approach the issue from a=20 slightly different perspective.
=20
If I am in /home/junk, and run "su -" the prompt changes to a root=20
prompt in the top level [/].
$ su -
... then your working directory _should_ be "/root", not "/". If it's
"/", then that means that your root account uses "/" as its home
directory, and that its ".bash_history" will be stored there, as
opposed to under "/root".
On 30/12/20 6:37 pm, Bit Twister wrote:
And that, is where problems are created. For example you edit some file
as "su", any configuration files/directories could become owned by root,
not junk.
I think that I understand this.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 418 |
Nodes: | 16 (0 / 16) |
Uptime: | 13:39:12 |
Calls: | 8,794 |
Calls today: | 6 |
Files: | 13,297 |
Messages: | 5,966,517 |