18 ms·
Systemd Home Directories
- philips 7y agoThe homectl command has some nice utilities too: with USER COMMAND: This command is useful for running privileged backup scripts and such, but requires authentication with the user's credentials in order to be able to unlock the user's home directory. resize USER BYTES: Change the disk space assigned to the specified home directory. https://www.freedesktop.org/software/systemd/man/homectl.html# https://www.freedesktop.org/software/systemd/man/homectl.htm... Also, if this makes setting up an encrypted home directory even slightly easier I am all for it. I setup ecryptfs on Rasbian a few weeks ago and there are a few steps that feel hacky if using a headless host and ssh.
- CameronNemo 7y agoI'm pretty sure homed does not support (purely) headless use cases. See minute 20:00: https://media.ccc.de/v/ASG2019-164-reinventing-home-directories#t=1184 https://media.ccc.de/v/ASG2019-164-reinventing-home-director...
- philips 7y agothat is a bummer
- Tecuane 7y ago> Inside of the home directory a file ~/.identity contains the JSON formatted user record of the user. It follows the format defined in JSON User Records. Why couldn't this have gone into ~/.config/? There's enough garbage cluttering my home directory.
- farisjarrah 7y agoI'm with you on this. They should use the XDG base directory standard
- jml7c5 7y agoI would suspect (though I'll admit without looking into it) that in order to know where $XDG_CONFIG_HOME is, one first has to load the user info. Bit of a chicken and the egg scenario.
- mixedCase 7y agoI'm the kind of guy who goes through $HOME every once in a while and start looking for workarounds or filing bugs requesting XDG Base Directory spec support. But in this case I can't complain. It's literally about the behavior of the home folder. This one makes complete sense to me.
- oefrha 7y ago> I'm the kind of guy who goes through $HOME every once in a while and start looking for workarounds or filing bugs requesting XDG Base Directory spec support. I used to be that guy. Now I’m not. Re workarounds: usually that means env vars, but all that crap in env is copied to the execution environment of every single process, which is pretty awful. Re bug reports: usually only a few “that guy”s care at all, sometimes there’s endless debate about whether things go into XDG_DATA_HOME or XDG_CACHE_HOME, the occasional accepted PR requires so much effort I might as well just try to forget about all the garbage sitting in the $HOME.
- anarazel 7y agoIt's needed before the actual contents of the home directory are available (i.e. mounted), if I understand correctly. Nor is it actually user-modifiable: > Since the user record is cryptographically signed the user cannot make modifications to the file on their own (at least not without corrupting it, or knowing the private key used for signing the record). > This file system should contain a single directory named after the user. This directory will become the home directory of the user when activated. It contains a second copy of the user record in the ~/.identity file, like in the other storage mechanisms. Not quite sure what the purpose of this copy is, given users can delete / replace it?
- userbinator 7y agoAlso this: Since the user record is cryptographically signed the user cannot make modifications to the file on their own (at least not without corrupting it, or knowing the private key used for signing the record). That sounds like something that shouldn't even be in the user's own home directory. ...and JSON, of all things. Every aspect of systemd which I've worked with seems to be full of sprawling complexity and overengineering, and this is no exception. I know "it's not the UNIX philosophy" is a common dismissive complait about it, but looking at the design gives a very different feeling than the "original UNIX" designs, which felt humble and simple.
- mixedCase 7y ago>...and JSON, of all things. Every aspect of systemd which I've worked with seems to be full of sprawling complexity and overengineering boolean, number, string, array, object, null Sounds simple to me.
- lokedhs 7y agoPlease tell me what you'll end up with if you encode and then decode the number 1E12 using two different JSON implementations. Check the spec, and then tell me if it's simple.
- zeveb 7y agoDoes the JSON number type permit me to store the number 123,456,789,098,765,432,123,456,789,098,765,432,123? When I read it in with a parser, what integer value will my code see? This is not an academic question: large integers are common, for example, as cryptographic keys.
- clktmr 7y ago>...and JSON, of all things. Right? Reasoning was "the web people are using it too". Why not just use key value based config files like every other system tool?
- stubish 7y ago
- stubish 7y agoThinking out loud, there is no reason .identity needs to be in the root of your home directory. The .identity file contains arbitrary metadata, which could just as easily specify which subdirectory should be mounted as $HOME. You could also move your other $XDG_ directories like .config out of $HOME.
- upofadown 7y ago.config is a XDG thing. The location of it is configurable. Which is the opposite of a standard and is a bad idea in general.
- farisjarrah 7y agoJust out of curiosity, why is it the opposite of a standard if its configurable? XDG home seems to have a sane default of .config, but also provides configuration with the $XDG_CONFIG_HOME environment variable. To me it looks like thats part of the specified XDG base directory standard. https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html https://specifications.freedesktop.org/basedir-spec/basedir-...
- upofadown 7y agoIt can hardly be considered a standard location if you literally make it so people will consider putting it wherever they like.
- jchw 7y agoThis seems pretty cool. A lot of the eCryptFS based home directory encryption stuff felt difficult to manage and not very sturdy whereas the fscrpyt and LUKS options here seem like they will be solid. Q: am I understanding correctly that you cannot use btrfs subvolumes while also using fscrypt? does it not make sense to use both? CIFS home directories is another feature I’m excited for. I’m sure it would have plenty of downsides to using a local filesystem but as of right now I find it cumbersome to have non-local home directories at all.
- SrslyJosh 7y agoGreat news! Can't wait to lose access to all my files.
- zzo38computer 7y agoMaybe this is useful to some people, but I think that it is not useful to me and that what I currently have is good. (I don't need the XDG stuff either though, and I don't use it.)
- jasonjayr 7y agoThis is new to me, and I watched through the video, and in usual fashion, any use case that he and his group thinks are not common, are just hand-waved away "that's not common" "You shouldn't do it that way" "If you want to use this, don't do that". Yet, all the things he mentioned, like, remotely accessing a locked laptop via ssh, or maintaining a external user database for a cluster of machines in LDAP, are things I do on a regular basis. He also mentioned something about requiring a privileged daemon to change your ssh keys? Is there any more information about that? Given the gravity of systemd, and all it's ancillary services, how long till this is the one true way? How does this work in the case of true remotely accessible multi-user systems?
- NikolaeVarius 7y agoDont use it then
- ta999999171 7y ago"Just leave the country if you don't like it."
- akvadrako 7y agoIt’s an optional feature. I doubt many people will use it.
- claudiawerner 7y agoThis idea is actually quite old; Socrates himself said this when a friend offered to break him out of prison. Socrates' argument was that if he didn't like the laws of Athens he could have gone somewhere else, but by staying in Athens he consented to its laws, so it was not his right to break out now, and he should have to face his sentence of death.
- candiddevmike 7y agoKeep in mind the main use case for this is local desktop/interactive sessions. For system/service accounts, you can still use regular passwd files, SSH auth etc. As you eluded to, the problems this is trying to solve include better integration/less rough edges with enterprise authentication (AD and the like), encrypting home directories, and making home directories and user accounts more portable. Anyone that does desktop fleet management will find a lot of stuff to be excited about here.
- silverreads 7y agoLike it, or we'll make fun of you!
- __jal 7y agoI think this may be where I step off the train. I grumbled, but can live with it as init, and it is easy enough to disable the ntp and name resolution nonsense to use decent tools. Buy systemd has no business sticking its nose in authentication or storage, or more generally telling me how to manage users. This is a no.
- candiddevmike 7y agoOn the contrary, having a single blessed, supported, and secure home directory utility will simplify a lot of tasks around generating home directories and encrypting them. You no longer have to figure out/solve automounting, decryption/rotation, or realms using a litany of bash scripts or stack overflow snippets.
- CameronNemo 7y agoYou are assuming that homed fits all use cases, which it certainly does not. It is opinionated and has a limited scope. This will add to the chaos, not subtract from it. I just hope the extra penetration of encrypted home directories is worth the added complexity.
- anderskaseorg 7y agoIf you want to rage at systemd, you can do that equally well with or without this optional feature: nothing changes unless you specifically tell systemd-homed to manage your home directory.
- __jal 7y agoWhy does any criticism of systemd have to be due to "rage"? There is this ongoing behavior whereby anything other than fawning praise is treated as irrational and emotion-driven. You may as well ask why Lennart rages so hard against ZFS.
- anderskaseorg 7y agoI’m not saying that all systemd criticism is irrational. I’m saying that this systemd criticism is irrational.
- stubish 7y agoThe article is describing a solution, but can anyone describe the problem or an article discussing it? I'm having trouble coming up with use cases where this is the best solution.
- emmelaich 7y agoThis article seems pretty snarky but OK. https://hackaday.com/2019/10/16/pack-your-bags-systemd-is-taking-you-to-a-new-home/ https://hackaday.com/2019/10/16/pack-your-bags-systemd-is-ta...
- jackewiehose 7y agoI still don't get it. The goal is to have your $HOME-directory on an usb-stick and use it on different computers? That would require having the same software versions installed on every system. But even then it wouldn't work because the user-settings stored in $HOME might depend on the hardware, e.g. monitor setup etc.
- silon42 7y agoMonitor setup is already a problem, I regularly switch between laptop screen, 1 monitor, 2 monitors or a TV.
- hottycat3 7y agoI think this is not for private users but for companies where the same or similar software and hardware configuration is used across systems.
- catalogia 7y agoUsually in configurations like that, the org likes having the ability to scan user home directories at will, for a variety of reasons. In my experience in those kind of networks, home directories are often on a centralized NFS/CIFS server.
- RabbiPires 7y ago
- inamberclad 7y agoI wonder if there's any other decent way to implement these features. Is systemd the inevitable solution to complex issues like this, or is there a more unixy way to achieve all this? Edit: isn't JSON technically not free-as-in-freedom?
- jammygit 7y agoI wonder sometimes how well you could apply Unix ideas to non-OS projects. Eg, game engines, web frameworks
- CameronNemo 7y ago>Edit: isn't JSON technically not free-as-in-freedom? One implementation was nonfree due to that whole don't be evil clause. Systemd uses json-c, which is permissively licensed from what I remember.
- e12e 7y agoWell, there's zfs encryption that might be easier for (among other things) home dir encryption. Eg this project (note, it appears to be early stages - but have a look at the zfs commands in the readme for a ses se of what zfs already supports): https://github.com/BenKerry/zfscrypt/blob/master/README.md https://github.com/BenKerry/zfscrypt/blob/master/README.md Apparently systemd doesn't consider zfs a friend, though. So I doubt we'll see integration from upstream systemd.
- anonsivalley652 7y agoSome celebrity software developers just seem to love making arbitrary, costly churn changes to existing standards, APIs and conventions to either feed their egos or hype themselves while imposing pointless costs, changes and risks on untold millions or billions of systems and users. Consumerist fashionabilism and obsolescence breaking changes rarely, if ever, serve a legitimate purpose. SMH.
- ta999999171 7y agoWho are these devs paid/"sponsored"/"supported" by?
- nickik 7y agoJesus dude. Maybe once in the your life consider that not everybody likes the same thing as you. People like you are the reason this is a toxic community.
- kbumsik 7y agoI don't understand why they are using JSON, especially systemd already use an INI-like config format extensively. Maybe because they are not web devs so that they haven't had an annoying moment when they realize there is no proper way to add comments in package.json?
- viraptor 7y agohttps://systemd.io/USER_RECORD/ https://systemd.io/USER_RECORD/ > Why JSON? > JSON is nicely extensible and widely used. In particular it’s easy to synthesize and process with numerous programming languages. It’s particularly popular in the web communities, which hopefully should make it easy to link user credential data from the web and from local systems more closely together.
- jmcs 7y ago> It’s particularly popular in the web communities, which hopefully should make it easy to link user credential data from the web and from local systems more closely together. Was this written by a CSI or NCIS screenwriter?
- throwaway17_17 7y agoI’m not asking rhetorically: Is a closer coupling between ‘the Web’ and local systems (especially concerning login and personal id) really what anyone needs? I don’t even think it’s what anyone really wants, but sure, let’s find a way to make some random server located somewhere run by some SaaS be responsible for negotiating rights to access our own hardware.
- GauntletWizard 7y agohttps://news.ycombinator.com/item?id=22287174 https://news.ycombinator.com/item?id=22287174 was on the front page of HN in the last 24h. Yes, web access to hardware is a top priority, because for a large portion of everywhere compute hardware is leased by the hour. It may not be the only way to access things, and I don't think the systemd maintainers will argue with you over the importance of single-box authentication robustness, only that compatibility is worthwhile and among the arbitrary formats there is a clear winner.
- hiisukun 7y agoOne of the things I am hoping for with this change is an easy way for me to log on to any computer I have 'synchronised' (such as my home laptop, desktop, or perhaps the wife's laptop if it has network access to home) and have the same home operating environment. Will it work? Will the small tradeoffs be worth it? (Like remotely logging in via ssh to a locked desktop machine somewhere...) ... I guess I'm thinking the Chromebook style experience, but without the google involvement. Separately - I've often wondered if iPhones couldn't be a bit more user agnostic in this way, perhaps among a family. Couldn't a son pick up his mother's iphone, log on with is Apple ID from the lock screen (assuming she has enabled 'family share') and have access to his messages, accounts, contacts, etc, but not large media? I can't see Android getting there sooner, but this would be a very useful feature I think.
- divbzero 7y agoI too would love to see this for the iPhone and even more so for the iPad. Apple implemented multiuser successfully for Apple TV with tvOS 13 [1] and HomePod with iOS 13.2 [2] but probably has less incentive to implement it for iPad, iPhone, and Apple Watch. [1]: https://support.apple.com/en-us/HT207936 https://support.apple.com/en-us/HT207936 [2]: https://support.apple.com/en-us/HT208714 https://support.apple.com/en-us/HT208714
- viraptor 7y ago> I can't see Android getting there sooner Why? iPhones still don't support multiple users natively as far as I can tell. Android has this by default since... 7? 8? Once you have everything set to sync to google services, it's really close to having this behaviour.
- jasonvorhe 7y agoMulti user support came with Android Lollipop in 2014.
- e12e 7y agoWhat happens if you have a user called "lennart.homedir"?
- guerrilla 7y agoEither it's lennart.homedir.homedir or you've found a bug.
- e12e 7y agoSo, you've got two users, "lennart" and "lennart.homedir"... I guess it would only be a problem when migrating, systemd is presumably happy to have lennart's home dir in lennart.homedir, and lennart.homedir's homedir in lennart.homedir.homedir... Ed: actually km more concerned with how this (doesn't) work with Pam, getent etc. If ldap, yellow pages or /etc/paaswd specify a home-dir that's not at /home/<username>... Should the system still look at <whatever path>.homedir? But only for interactive logins? Will a daemon running as the user have a different home dir? Will cron? At? The system processing dot.foward/sieve filters?
- dusted 7y agoI'm not sold on having plaintext-files which cannot be edited by hand. I'm only slightly doubtful that this will do us great in the future, but I think I'll be a late adopter. I imagine there is a lot of unforeseen consequences. There's also the deal with recovery from bad situations (tm) or reviving long-dead home accounts.
- bpfrh 7y agoI thought one of the big selling points for this was the ability to move the homedirectory from one device to another via usb or hdd? Then how will they verifiy the signature of the user json file? So I can't simply remount the user profile on another system? Seems like a step back.
- Aardwolf 7y ago> I thought one of the big selling points for this was the ability to move the homedirectory from one device to another via usb or hdd? I've been able to do this for decades, just copy the files. Why would I want systemd for that? systemd has already made my textual log files binary and only accessible with their own viewer. Now it's going to apply its philosophy to my home directory too?
- Spivak 7y agoYou have a pendrive containing your encrypted home directory and you can plug this drive in to a machine that doesn't a priori have your user account info and log in to your account without administrative privilege. This could genuinely be a viable lightweight alternative to LDAP/IPA in offices that hotdesk. Just sign the user's drive once and they can plug-in to any workstation.
- qu4z-2 7y agoI don't really understand why they bother to encrypt it if you're going to be typing your password into presenter laptops, etc...
- Spivak 7y agoBecause someone who steals your drive can’t decrypt it? How could you possibly design a system where you can plug a drive into an openly hostile machine, decrypt and use it, and have that machine not be able to access your password or files?
- Aardwolf 7y ago
- dreamcompiler 7y agoI already have a Swiss army knife program that manages my life, makes sandwiches, and takes my dog to the groomer. It's called Emacs. I don't need another.
- zeveb 7y agoAnd Emacs uses a nice, simple, sane, universal configuration file format (S-expressions) while systemd uses .ini files (on Unix!), JSON, binary and no doubt something else somewhere else. Hmmm, maybe it'd be worthwhile to just make emacs PID 1.
- deleted 7y ago[deleted]
- throwaway17_17 7y agoI think the use of .ini files is exceptionally appropriate for systemd. The developers are at there most transparent here, it is essentially them saying “we want to be Windows, we want to be the ones who control your system, we make the decisions and you should be thankful that insightful, expert, never ever ever wrong developers like us grace you with this software.” (Obvious fake quote, is obvious) I know the sarcasm is heavy there, but the attitude of the developers of systemd seems to be honestly geared in this direction. So, Of course they use .ini files on Unix, because they want the same sort of mono monster, one true path OS that Windows has.
- kazinator 7y ago> we want to be Windows You mean, we want to be nice Windows, before the Registry?
- CameronNemo 7y agoFwiw systemd definitely does not use ini files. It uses some weird scripting language that looks sort of like ini but has logical operators, clear statements, and the ability to assign multiple values to one key.
- 7y ago
- znpy 7y agoBut what if somebody already has data on some other volume-managing filesystem (like, say, ZFS) ?
- smabie 7y agoIf I could just switch to OpenBSD for all my work I would be really happy, Linux and all the junk on it is a dumpster fire. Now that we’re in the late stage of Linux being built out of a huge pile of seperately developed components the usability of the system has plummeted to an absurd level. I thought the config file story was bad, and now systemd wants to add auto generated json to the mix (in a top level file of my home directory, no less). Now Linux feels like all the other “enterprise” systems I deal with on a daily basis: baroque, complex, confusing, and over-engineered.
- RabbiPires 7y agoGet out of my house, Poettering!
- j0057 7y agoThe merge request for this feature is here: https://github.com/systemd/systemd/commit/4119d1e60a111bacca359b61b5bc3dae29932b67 https://github.com/systemd/systemd/commit/4119d1e60a111bacca... -- more than 21K new lines of code. I'm not too worried about this being a "predictable interface names" type of solution to a problem I'm not having. What I'm really worried about is that of those 21K lines of code, only about 100 lines deal with testing, in the form of two bash scripts performing end-to-end tests against the main executable `homectl`. At $DAYJOB, we find that to achieve any sort of acceptable coverage (which we've arbitrarily defined as 80% or better) -- you'd expect the ratio of production code to unit test code to be close to 1:1, and not anywhere near the 200:1 like this code here. I mean, either those are some _very_ efficient E2E tests, or we have a small number of happy paths being covered here, and we the users will have to weed out all the corner cases that weren't tested. Moreover, since these are E2E tests and not unit tests, that makes me immediately worry about the quality of the code. I know that unit testing is not very common on C-land, but is it really that unheard of in C-land in 2020?
- ilovecaching 7y agoIn the kernel with have selftests, which are basically just regular binaries run by make. I didn't do a lot of C unit testing before I started writing selftests, but now I don't see a reason not to, I just made my own little version of the selftest makefile and use that. C code can be tested like any other code it's just made more difficult by the fact that most C code is very concrete and doing systemy things that are harder to isolate.
- stubish 7y agoHow is the key handling being done? If the .identity file is signed, then workstations will need to look up the key on some keyserver to see if the key has been revoked. This also limits use to online-only. Without key revokation and online-only, ex-employees plugging in their home directories and regaining their employee privileges, because the trusted .identity file says they are in the staff group.
- z3t4 7y agoWhat about ZFS?