5 ms·
Fedora 40 Plans To Unify /usr/bin and /usr/sbin
- rahimnathwani 3y agoThe separation made more sense when disk space was scarce, but I guess no one today is using separate partitions for /bin /sbin and /usr, or mounting /usr over NFS.
- pengaru 3y agoMore granular filesystems limits the blast radius of filesystem corrupting events. Hard disks used to fail pretty often, filesystems had (and still have) bugs. It makes sense to stick your administrative utilities needed to run/recover a given system in its own little less frequently modified filesystem vs. user applications that tend to see more churn/use in general. It's not strictly a disk space issue.
- nuc1e0n 3y agoOn linux the initrd filesystem can do this IIRC
- brirec 3y agoIndeed most Linux distros today first boot into an initrd filesystem, mount the “real” rootfs somewhere, and then `pivot_root` to the real `/` while calling init (usually systemd) these days
- znpy 3y agoAn important part of passing the red hat certified system administrator (rhcsa) was to be able to recover a rhel system that was failing at booting… i got that in my exam, and i suspect that’s present in every exam session. Good times, I miss working on rhel systems.
- brirec 3y agoOnce you can boot “by hand” from a Grub prompt a lot of the magic starts to disappear…
- mongol 3y agoAfter having moved to NixOS, this type of evolution feels archaic.
- charcircuit 3y agoNixOS itself still also has problems. The configuration / state for a program is scattered between /etc /nix/store ~ ~/.config /var instead of being in a centralized place. An application can be thought of as a combination of the binary, libraries, resources, and state. By default the applications needs to be able to read any of these and be able to read and write the state. Unix's FSH's biggest problem is that it tries to group files together by type instead of grouping files together by application. Nix can technically group things by application, but it is not really standardized so things can get messy and it is still normal for applications to read and write files from anywhere.
- someplaceguy 3y ago> NixOS itself still also has problems. The configuration / state for a program is scattered between /etc /nix/store ~ ~/.config /var instead of being in a centralized place. Those are features, not bugs... There are reasons for all of those existing and for why you wouldn't want everything in a centralized place.
- charcircuit 3y agoThe same could be said about having /bin /lib /usr/bin /usr/sbin /usr/lib /usr/local/bin /usr/local/lib ... yet these were all merged into /nix/store. NixOS's handling of state is poor. Even ignoring the problem of it all being spread out it is not uncommon for secrets to make it into /nix/store which is world readable.
- mongol 3y agoSecrets handling is indeed an issue, you can shoot yourself in the foot if you are not careful. If you are careful you can avoid it though and it is not neccessarily difficult. It is certainly is one aspect of NixOS that requires care and can be improved. But to me, it is not so bad as to avoid it. The advantages outweigh the disadvantages with a wide margin
- rwmj 3y agoThe mailing list discussion has been (surprisingly) supportive: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/OUNAAHIVSYMNXHJ2AMTE5FEPNLSB5RMZ/ https://lists.fedoraproject.org/archives/list/devel@lists.fe... While I was looking up that link, I found the original discussion for Fedora 10 (2008) about adding /usr/sbin to $PATH which was a little more controversial (at the time): https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/2PXUACL5F2SF4DZAHKJIBMB6CWSL5AC2/ https://lists.fedoraproject.org/archives/list/devel@lists.fe...
- derefr 3y agoWhat was ever the point of the $PREFIX/bin vs $PREFIX/sbin division, anyway? I understand the historical reasoning for the / vs /usr vs /usr/local split — • / was a mount of the machine vendor's installation-engineering-provided bring-up tape — a tape that could usually be safely unmounted once boot was complete and the kernel + persistent daemons had loaded into RAM. (We still have something akin to this in Linux land in the form of the initramfs!) • /usr was a read-only-mounted OS distribution, either spooled onto the same tape drive that had been reading the rootfs tape a moment before, or (later) over NFS from a high-read-IOPS shared disk server, where in either case the mountpoint was expected to never go away while the OS was running, and therefore the loader could spawn binaries from here using flushable memory-mapped disk IO (allowing far more running processes to fit within the machine's limited memory — important for time-sharing!); • /usr/local was a separate site-specific mount of stuff added by the local sysadmin — often created as a separate "tacked on the end" partition on the OS distribution tape (you could just attach more tape on the end of the reel, and then format it!) Later, once machine-local hard disks were a thing but Unix systems were still generally mounting /usr over NFS, /usr/local evolved to be the read-only partition of the machine-local HD (and such systems gained a matching read-write local-disk partition, /var.) But $PREFIX/bin and $PREFIX/sbin were, as far as I know, always just regular directories under the same $PREFIX-level mountpoint, never separate mountpoints of their own. The only difference I can even think of between a $PREFIX/bin and a $PREFIX/sbin dir, is that the $PREFIX/sbin dir wasn't in $PATH for most users. But surely that was never a real line of defense for security?
- kristopolous 3y ago/usr was initially for users. See Kernighan's Unix for beginniners from 1974: https://archive.org/details/unix-for-beginners/page/n5/mode/2up https://archive.org/details/unix-for-beginners/page/n5/mode/... or this 1982 text from Bell Labs: https://archive.org/details/unixsystem0000bour/page/10/mode/2up https://archive.org/details/unixsystem0000bour/page/10/mode/... Even in 1994 this was still common, https://archive.org/details/learningunix0000gard/page/48/mode/2up https://archive.org/details/learningunix0000gard/page/48/mod...
- derefr 3y ago
- nuc1e0n 3y agoIsn't the separation of programs into sbin to prevent users without system admin permissions having even read only access to certain programs? Is that not relevant now?
- stryan 3y agoOutside of what the article itself says, even while I was managing large multi-user Linux installs that wasn't really a concern we had. At this point the benefits and concerns are minimal.
- layer8 3y agoRead the linked change proposal.
- halJordan 3y agoYep, it's not relevant. If you click through to the change proposal, you will see their reasoning.
- nuc1e0n 3y agoMeh. I'm not bothered whether they're merged or not then. All these folders are administered by rpm anyhow.
- cycleslow 3y agoUhhhh, more than rpm exists. I fail to see a problem that is solved by merging them. I guess some fresh project manager with nothing to do believes they found some low-hanging fruit to get their name on something. ¯\_(ツ)_/¯ It's a waste of time to reinvent this wheel. It will probably make things worse. Many of these ideas come from folks who started with something other than a *nix and are trying to make things feel more like home rather than understand why things are the way they are.
- brirec 3y agoI’ve never seen a distro that didn’t grant read permission to everyone for /sbin and /usr/sbin. In any event, it doesn’t really make sense to me to deny read access for any executables, so long as you don’t also deny read access to Python or a C compiler. Really, if permission mode bits are the only thing preventing damage from such tools your vulnerability is not within your path or mode bits.
- kristianpaul 3y agoGood luck
- jchook 3y agoVoid Linux does something similar. /bin, /sbin, /usr/sbin are all symlinks to /usr/bin.
- cycleslow 3y agoTook the teeth out of that one. Why not put it all in /home? Why not just put the sink in /stuff and link everything back?
- westurner 3y agoIf you don't need root to run it, don't install it in */sbin/. Packages are installed into /usr/bin and /usr/sbin. Locally-built software (e.g. `./configure --prefix=/; make; make install`) is installed into /usr/local/bin and /usr/local/sbin, which should still always require elevated privileges to write to. ~/.local/bin is convenient but dangerous, because a process should not be able to overwrite itself on disk (unless the user has allowed it to auto-update itself, instead of using a package manager with out-of-band public key retrieval) This is all probably in the discussions, A. "Audit all binaries run as root" (TODO lookup the probably CIS control URL for this; look for disk-resident programs that run with elevated privileges) A.1. Find setuid and setgid files: sudo \ find / -type f \( -perm -4000 -o -perm -2000 \) -exec ls -ld '{}' \; \ 2> find-setuid.errors \ > find-setuid.files A.2. Find setcap binaries A.3. Find extended filesystem attribute permissions with e.g. getfacl A.4. List everything in */sbin that only root users should need to run (*) A.5. Find everything that's `chown root; chmod o-x`; (When you remove the e(x)ecute bit from a directory, that user/group/other can't list the files in the directory; which is logged to stderr when e.g. `find` Nowadays we can just do the SBOM tool on everything in every */?bin direcotry and just check those If "merge sbin into bin" isn't already changed in the FHS spec, I'm -0 to -1 on the idea and don't see really any benefits. Filesystem Hierarchy Standard: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Disadvantage: Users would inadvertantly exec() programs they don't need to run log exec()s of, if /sbin and /bin are merged; there will be more binary enumeration log messages to parse. Disadvantage: Other distros won't merge /sbin and /bin, so the paths in log messages in support issues and mailing lists would be less universally searchable