Come to think of it, I do see one practical issue with this. While sudo works for running programs as root, it doesn't seem to work for running graphical programs as a non-root ("standard") user. Take what happens for gedit:
Code: Select all
$ sudo -u foo gedit
[sudo] password for *******:
No protocol specified
No protocol specified
Cannot open display:
Run 'gedit --help' to see a full listof available command line options.
A non-graphical program, like ksh, runs fine... but even trying to run qtconfig from there:
Code: Select all
$ qtconfig
No protocol specified
No protocol specified
qtconfig: cannot connect to X server :0
Do you know of any workarounds, or does this limitation not apply to the slaves for some reason?
Thrawn wrote:That's kind of the point.
Well then IMO this is a great idea at least in theory.
I tried to use this script in my Lubuntu VM, but couldn't:
Code: Select all
chmod: missing operand after ‘o-rwx’
Try 'chmod --help' for more information.
Looks like you have an undefined variable.
Thrawn wrote:Yes, but it is also much more overhead,[...]
Oh, I was mostly kidding about that, thinking what with Firefox Hello & Pocket & Heartbeat & Health Report & unremovable socialware &...
sorry I didn't make that clearer.
Thrawn wrote:I'm not following you; in what circumstance would there be a lot of copying around?
I would envision that the master does all of its web browsing via a dedicated slave. Or possibly several slaves, if you really want to isolate different sites from each other.
If you want the profile in the slave to be totally disposable, as in when done with Firefox you delete the slave's profile and re-populate it with the master's copy of the profile.
I guess what I'm getting at is that there's an extra level of protection (mainly from potentially dangerous user actions, but also from websites tracking you) if the profile is
maintained in the master account, regardless of how much web browsing is done through the slaves.
Thrawn wrote:There's not all that much that is globally writeable on a normal Linux system, except /tmp.
Nothing in /var?
And as far as you know, anything written in /tmp by the slave for the type of uses you're thinking, would be owned by or belong to the primary group of the slave?
Thrawn wrote:
I was thinking in terms of whether the system's sudo would be set up to recognize things in the sudoers.d directory.
Good point. That depends on the core sudoers file. Theoretically the script could edit that instead, but doing that robustly would get a *lot* more complicated.
Well if this kind of difference is all done in the configuration files, then all that your script has to do to be portable enough is contain a note that it requires the sudoers.d directory set up. It's probably best to just `test -d /etc/sudoers.d`, and if it's not there, echo a message and exit 1. It's not up to scripts like your example to actualky reconfigure such core system programs, but I wouldn't consider it an issue if it *requires* certain configurations (that is, that can be set in config files) of its dependencies.
Thrawn wrote:I did use the low-level commands (useradd, usermod) instead of the higher-level adduser etc. Admittedly, that was mostly so it would be more suitable for non-interactive use. I'm not sure how portable they are.
(emphasis mine)
Meh, I was getting mixed up with command-line utilities like adduser, assuming that it took the place of useradd/usermod.. oops
Then it's not all that varied, just one or two command line options behave slightly differently (even if you add *BSD in the mix).