On 17Jul2013 17:18, highskywhy@yahoo.de <highskywhy@yahoo.de> wrote:
| > | >>> su user2
| > | >>> sudo firefox
| > |
| > | will open open firefox in the existing X session of "user1" while
| sourcing
| > | user2's firfeox profile/bookmarks, etc.
| >
| > Yes, but only because you're now running firefox as root! Surely
| > not the plan. It also tends to litter your homedir with root owned
| > files ready to cause inconvenience later.
| *
| Is this the same situation
| today I am booting as user1
| and
| tomorrow I am booting as user2.
Try to avoid this notion of "booting". Booting is what happens when
you shut the machine down and start it up. You may be doing that,
but it is overkill. Just log out, and log in as someone else. If
your desktop has some kind of "switch user" facility, that is even
more convenient.
| What kind of firefox are 1 and 2 using?
They'd be running the same firefox, but as different users. Hopefully
with the files in each user's specific home directory. This is
reliably done using separate desktops, one as each user.
When you start using "su" you have some pitfalls to consider. Many
programs rely on the $HOME environment variable to decide where
files should go. If you use "su user2" instead of "su - user2" then
$HOME will probably be user1's home directory. Chaos ensues. The
program may well try to write where it has no permission.
Worse is plain "su" or "su -". That means "su root" or "su - root".
It will have the same "wrong directory" issues, but root will not
be troubles by permissions. It may well write all sorts of files
on user1's home directory, owned by root. The user1 will have trouble
laters when he/she encouters these files.
Conversely, (with "su -") the program may run as root, and you end
up leaving personal stuff in root's home directory.
Keeping things in distinct desktops and avoiding "su" is far less confusing.
Cheers,
--
Cameron Simpson <cs@zip.com.au>
Why be politically correct when you can be right?
- Geoff Miller
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (13) |
No comments:
Post a Comment