Systemd-homed merged as a fundamental change to Linux home directories
phoronix.com
phoronix.com
What's the point? This is not the 1990s. Who exactly is this for?
Who actually has multi-user systems. Really has them.
Clients are either all single-user laptops (at home and at work), or single-user workstations. Very rarely they're multi user workstations, but then they use something non-local for their home directories anyway, so again who is this for?
This isn't the 1990s with 100 users on your computer club Linux server. Everyone just gets their own VM, now.
Honestly, who still runs a 1990s style shared shell server?
And per-user /home encryption on a shared system just sounds like a threat model contradiction. If you want to protect the users from each other then turning a blind eye to the regular local root exploits sounds odd at best. On servers for cifs /home if my home directory is secret, why would I expose it to every server I log in to?
And if not for human user accounts, how will this help anyone run their docker containers or any other type of service?
Am I just out of touch? Does this actually have users? Does it actually solve a problem?
It breaks many use cases, that's very obvious.
Please be aware that that the common semantics are that permissions are associated with a file, not with its name (and a file may have a lot of names through hard links, or no name at all - open a file, delete it, and it is only accessible if you have an fd, or with little more work through the inode number)
effectively you want to be able to say: share this file with joe, or
share -rw joe john ... file ... destination/;
something along those lines that will change the acl as needed.Not much differently than sharing a USB volume.
This way you retain each user's privacy, since main groups aren't changed, don't need to run custom scripts each time, and don't have multiple copies of the shared files. The only (IMHO minor) issue would be that newly shared files might only be accessible for the other user 30s later on average, and 1 minute at most. The cron job might be converted into a daemon monitoring new files appearing in /home/user3, but that is left as an exercise for the reader :)
setfacl -R \
-m d:u:user1:rwx -m u:user1:rwx \
-m d:u:user2:rwx -m u:user2:rwx \
/home/shared
d:u: sets the default user ACL for future directory entriesu: sets the current user ACL for existing directory entries
-R sets the ACLs recursively on existing files
I also think it's likely there are future solutions which will be made possible that we can't even imagine right now, through what this brings to the table.
I manage huge compute clusters, with and without VMs, and can't imagine a feasible use case for this, barring a time machine to the 90s.
No. First of all, in general disk encryption is orthogonal to multi-user or multi-seat systems, and the same case for disk encryption can be made wrt VM sessions. Secondly, the main feature is migratable and self-contained home directories, which is also relevant for VMs (or even more relevant).
Still, the main aim of this is in my opinion not safe isolation of users on a single machine, but rather safe locking of the encrypted root folder.
With a normal LUKS setup, everything is inside a LUKS container, including the rootfs from which the OS itself is running. This complicates locking the LUKS container when the device gets suspended, as there will be open files, etc.
With Homed as far as I can tell, this is explicitly possible, it should be able to drop the encryption keys when machine goes to suspend, making it less likely your data will be recovered if the machine gets lost or stolen. With the keys in RAM an attacker might attempt to pull it from the machine & read the keys or use some method to defeat the lockscreen. With the keys dumped from RAM, this is no longer possible.
> [locking when suspenden] With Homed as far as I can tell, this is explicitly possible
Is it? Your home dir definitely will have open files when you lock or suspend.
https://github.com/guns/go-luks-suspend from 2013
This also doesn't accidentally leak all the stuff not within /home/you
School labs with many shared computers for kids high school aged and below.
Larger servers at colleges for projects that are just unreasonable to run on a standard desktop machine.
But again: What's the threat model for LUKS, here? A student has their stuff on that exact shared machine in the computer lab, and somehow local root attacks only work when attacker is alone on the machine?
In other words, you personally don't use multi-user systems, and somehow you interpret that as no one having the need for multi-user systems. Does that make any sense?
Speaking for myself, if multiseat Linux boxes were more easy to setup, I would certainly use one of those as my family's primary desktop. Today's desktop systems are quite capable of taking a multi-user computational beating and breeze through any amount of browser windows opened. Thus, if buying a monitor and keyboard is all it takes to get another computer seat then why not?
And a Raspberry Pi.
Not sure I've heard of people using it, but I'm curious!
Enter multi-seat. A few "sticky" commands later (i.e. only needed for reconfiguration, not on every boot) I have three user stations, each with monitor, keyboard, mouse, audio and at least one dedicated USB socket. Works a treat. It's not 100% bulletproof; crashes to the point of needing a reboot maybe 2-3 times a year, but aside from that indistinguishable from dedicated computers for each screen.
Stock Fedora 28. Here's the sum total of commands needed to set up the multiseat in my setup (seat 0 gets everything not assigned to the others).
loginctl attach seat1 /sys/devices/pci0000:00/0000:00:09.0/0000:05:00.0/drm/card0 /sys/devices/pci0000:00/0000:00:09.0/0000:05:00.0/graphics/fb0 /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-5 loginctl attach seat2 /sys/devices/pci0000:00/0000:00:07.0/0000:04:00.0/drm/card2 /sys/devices/pci0000:00/0000:00:07.0/0000:04:00.0/graphics/fb2 /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-3 loginctl attach seat2 /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-4/1-4.1/1-4.1.4/1-4.1.4:1.2/0003:046D:C52B.00A3/0003:046D:4004.00A4/input/input194 loginctl attach seat2 /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-4/1-4.4/1-4.4:1.0/0003:045E:00B9.00A5/input/input195
I hope this functionality doesn't turn into abandonware before I'm done with this monster machine i.e. it breaks or becomes too obsolete. I did in the past try to set up multiseat, just for fun, with a Displaylink box, after reading the article about it, but got nowhere, with the distinct feeling that they got it working once, and then abandoned it.
You run into occasional other "more than one user per computer" issues. For example, trying to access the same UDP RTSP camera from VLC on two different desktops.
And the three desktops do get actively used by three differerent family members. Linux on the desktop for non-geeks/kids? Nobody cares. As long as the browser works with full video capability (smooth 1080p Youtube) and, in the child's case, the Tuxpaint painting program, everybody happy.
So you do need the multiple video cards (and slots to put them into). One per user. And even more idle power consumption. But the 124W that the machine now sucks down 24/7 is sort of justifiable in that it serves the whole family's browsing/computing needs aside from a few smartphone type gadgets. And the setup is physically robust, in a household with small children, in a way that laptops just aren't.
Cheap 7m HDMI cables and active USB extension cables (from Ali Express) take care of the physical separation between stations.
Sound is easy as long as you get it over HDMI - no need to configure a separate device, it comes with the video. But one of the stations owns the physical audio sockets on the motherboard, and one, for reasons too complicated to get into here, uses network audio over another Lennart special -Pulseaudio. That has its own frustrations, but the remote audio, once I got it working, has been solid.
Also, are you using wired networking for remote audio? Last time I tried PulseAudio remote audio over wifi it instantly made wifi useless for everyone in the house. (Honestly I wouldn't mind mildly lossy compression, but there doesn't seem to be support for that.)
No need for personal attacks.
I note that you opted to ridicule instead of answering, which I find unnecessary.
The fact that you are unfamiliar with a use case doesn't mean it doesn't exist.
Oh, I agree! That's my point. So what is systemd trying to solve?
We do. We have like a dozen shared, beefy shell servers (varies, but think ~32 core not too old Xeon, ~256GB RAM, 1G or 10G stable network that's local to the office, TB's of storage and essentially unlimited on NFS) for devs (and more of the same dedicated for CI/CD).
We need this because the codebases are huge and take hours to build on a laptop (and copying across a home uplink would take forever too).
Homedirs are NFS mounted.
It's more cost efficient than spinning up an AWS/Azure instance for myself, and more limited resource efficient than spinning up a VM in OpenStack (both of which I do when appropriate). And it's very convenient team work wise.
There are (many, some avoidable but hard to fix by now) downsides for sure, but I cannot imagine doing this work solely on a laptop.
So do you run fscrypt or LUKS with that?
Because NFS was already possible, so what is systemd trying to solve?
> encrypted home directories?
This is something that isn't widely available on personal systems that would be supported by this change.
I should note I think the idea of systemd is valid, but I am not a fan of the implementation. (binary log files? disorganized configuration directories?)
So… this has not been a problem for 99%+ of users for like 20 years.
I do like the idea of some parts of systemd. Like structured logging. I'm so sick of every single tool having its own logging format. Some multi line, some not. Some using UTC, some not. Some making up their own BS date format, etc…
Even on a single user workstation, having an encrypted root filesystem doesn't do as much good if your laptop is left booted up with the root filesystem unlocked most of the time. Systemd-homed in that scenario is supposed to make it easier to automatically unmount/mount on locking/unlocking the workstation.
systemd-homed isn't about multi-user systems, it's about multi-system users.
Goal #1: Migratable Home Directories (all the way to the point of "home-on-a-stick") https://cfp.all-systems-go.io/media/homed-asg2019.pdf
I want to take my home with me across all my systems, and /don't/ want network sync to do it with.
I don't really understand why distribution maintainers are allowing this one project to have so much control over the operating system.
1. The project really doesn't have that much control. Like packaging any other software, it adds a feature you can choose to install, but it does not affect the distro if you don't enable it.
2. The project generally comes up with good ideas, or at least better ideas than the shared consensus of historical UNIX practice, such that incorporating the product's changes is a sound technical decision.
In this case I suspect it's 1 - the article points out that it's optional.
I didn't want systemd, and there wasn't really an option for me to 'disable' it. I switched distros, because that was vastly easier.
> The project generally comes up with good ideas, or at least better ideas than the shared consensus of historical UNIX practice
[citation needed]
I'm talking about this feature that is the subject of the article, not systemd in general.
> [citation needed]
I'm discussing possible reasons why a distro might choose to trust systemd. Perhaps I should have said, "The distro believes that...." Whether systemd does or does not do this is debatable, but it certainly seems possible, which is the entirety of my claim. (Also, I'm tentatively concluding that this is not the reason why distros are okay with this particular change.)
I think so. As it stands, you are flat out stating that systemd produces better system design than UNIX - which is not only questionable of itself, but in blatant disregard of those who disagree with the systemd design philosophy.
I’m sure the distro leads are smarter than I am, too.
If you don’t like systemd then the only sane option for you is to make the jump to FreeBSD.
I’m not in love with systemd, personally. But it’s harder to live without it than with it.
That was the tipping point for systemd adoption, caused by incestuous relationship between systemd, GNOME, and Fedora.
I think the answer is the same: this is emergent behavior.
Nobody is in charge, so somebody does something in their own self-interest and the effects cascade widely.
Systemd adds a feature, few know about it, and it spreads via the normal release channels.
Same thing happens with telemetry. Docker has telemetry, ubuntu keeps screwing with it, etc.
Every program attempts to expand until it can read mail. — Zawinski's Law
See systemE.
I used to feel the same way. I’m only a casual linux user and I didn’t want to climb this particular mountain but having learned just a little about it, created some of my own units and played with the tools the sense of alienation dissipated and I was fairly happy with it.
Speaking as a distribution developer, I can say that systemd has bitten me in multiple ways due to upstream bugs that are either ignored or left to rot for quite a while. I've had to resort to patching them, or working around them, which makes things very difficult to live with, especially given the pace of systemd development and feature additions.
The older software had a number of bugs, yes, but they were well known and battle tested. In short, it's not "I don't want to learn" -- it's "the new shiny has a slew of unknown bugs we can't easily identify and fix".
[edit: removing bits of incendiary text]
For me personally, it's also that systemd keeps expanding and expanding, which both makes more things dependent on their security profile and reduces choice in the ecosystem. The number of different boot/init systems I might need to use is pretty limited and I might be OK with just one (especially since systemd /is/ really good at it). The number of DHCP clients, firewall systems, DNS clients, and so forth is decidedly not so limited, and results in a nasty choice of "use the systemd thing and hope it supports all the features you need" or "rip out the systemd thing and replace it and hope that works and continues to work" or "install something that sits on top of the systemd thing and thus has to interact with it in strange ways that may bite you unpredictably". Each of those is a recipe for a lot of Maalox moments, and it feels like the response to that concern is, "Aww, you're just being a worry-wart."
For business vs systemd... you gotta keep your crew busy with change, right?
For home use, sure, there's a joy to making things work. Same as some people enjoy building a computer from parts - but you'll never see a business telling their employees to go to PCPartPicker and put something together.
> single cronjob that starts a big supervisord
/me screams
Seriously, why? All of those you're listing are monsters, and they should never have existed in the first place.
Has anyone played with it any? I know it just got merged, but I figure one of you may have tried it prior to that, so I might as well ask.
I haven't played with this, though. I don't have a use case for it.
What would happen if the daemon goes down or has security hole? Are users screwed?
Took some research and at least an hour of my time... something was not set up in the user slice configuration for systemd's liking.
This has been my main objection to it: feature creep (with tight coupling between 'components').
systemd was never just an init replacement, it's a project that includes an init replacement.
I don't do games consoles, only business systems.
I was pretty shocked that I needed to have three files. My backup script, a systemd service to call the backup script, and a systemd timer to call my systemd service that calls my backup script.
It took A LOT of fiddling and reading the Arch wiki before I had everything working as I wanted it to.
You can also find more documentation on the official systemd website, or Gentoo, CoreOS, and RedHat's website.
As an example: https://wiki.gentoo.org/wiki/Systemd#Timer_services
1) create systemd service to call your script
2) create a systemd timer to call that service
What did you do differently?If you listened to the original talk from Lennart, you're really just giving examples of one of his major points. Because /etc/passwd wasnt flexible enough to accomodate arbitrary user properties, user configuration has organically spread out over time into all these "side car" configuration files. Some are scattered around /etc so not easily portable while others are in the user's home directory and suffer from exactly the scenario you've mentioned. One of the goals of systemd-homed is to add a portable, extensible format for a user record external to the home directory which would mean that systemd-homed rather than causing, could actually lead to a solution for the issue you've highlighted.
But in order to do this there should be some kind of a standard so that pretty much any app could integrate into such tool if it listed allowed settings and its locations.