Reinventing Linux home directories with systemd-homed
Managing Users
Like other systemd services, systemd-homed comes with its own command-line management utility. You will not be able to use the useradd
utility or other classic command-line tools to manage systemd-homed users. Instead, use the homectl
command to create, remove, or change a user directory. The homectl
command supports several subcommands and options for setting up a user or changing user account settings.
For example, to create the user bennie for someone whose real name is Bennie Beanbag and to assign 400MB of disk space to the user directory, use:
homectl create bennie --real-name="Bennie Beanbag" --disk-size=400M
See the box entitled "More on homectl" for some of the basic homectl
commands, or look for the homectl
documentation to study the many options and command variants [3].
More on homectl
The homectl
command has the following syntax:
homectl [OPTIONS...] {SUBCOMMAND} [NAME...]
The numerous options include format settings, user record properties, encryption settings, and more [3]. Some of the important subcommands are:
list
– list all home directories currently managed by the serviceactivate
– activate one or more home directoriescreate
– create a new home directory with the specified namepasswd
– change the password on the specified home directory and user accountresize
– change the setting for the amount of disk space assigned to the specified home directorylock
– temporarily suspend access to the user's home directory and remove any associated crypto keys from memory
The wide range of options and subcommands within a single command is similar to the format used with other systemd services. Unlike old-school command-line utilities, which tended to have a single, specific purpose, the broad and versatile systemd utilities encapsulate several different tasks within a single command structure, which leads to very tidy and hierarchical documentation. However, like systemd itself, it poses a challenge to those who prefer simple tools with a single purpose.
What's It All For?
The systemd developers do not think of systemd-homed as a solution for all situations. First of all, this technique is not intended for system users (users with a UID<1000). In general, systemd-homed is intended for end-user accounts. The ability to move a complete self-contained user home directory – not just user files – but the complete configuration and even login information, could be a major benefit in some environments. But even if you don't plan on migrating your home directory, having a user directory system that is integrated with the rest of systemd will be a welcome development for many users and admins. Of course, the chorus of users who don't like systemd in the first place are certainly not going to like it more because of systemd-homed.
Several potential users have already expressed concerns with how systemd-homed will handle SSH. If you've been paying close attention, you've probably already come to realize that, if systemd-homed leaves the user's home directory encrypted until successful login authentication, how will users be able to log into a remote machine via SSH? Remember, the .ssh
directory exists within the user's home directory (in ~/.ssh/
).
No universal solution to the SSH problem exists at this point, but, as Lennart Poettering recently pointed out on Reddit, systemd-homed is intended for laptops, workstations, and client systems "…machines you SSH from a lot more than SSH to…" [4]. The primary purpose is to support local login on end-user systems.
The biggest fear that comes with systemd-homed is that users and administrators will have to learn a new way of handling authentication and home directories. This is especially true for app developers, who might very well have to make serious changes to how their applications deal with these issues.
And although change is something most feared, others believe this change might well be a change for the better. Linux has been in need of improvement with how it handles user authentication and the home directory. For those who have been hoping for better home encryption, a centralized authentication system, and more portable home directories, systemd-homed is exactly what you've been looking for.
You can test systemd-homed in v245-rc1 from GitHub [5]. The installation of this system is not for the faint of heart, so it's best to wait until the official release is available to kick the tires. The release of systemd 245 should happen sometime this year (2020).
Infos
- systemd: https://systemd.io/
- systemd-homed: https://systemd.io/HOME_DIRECTORY/
- homectl: https://www.freedesktop.org/software/systemd/man/homectl.html
- Poettering regarding SSH: https://www.reddit.com/r/linux/comments/d6w03y/systemdhomed_reinventing_home_directories/
- systemd-homed at GitHub: https://github.com/systemd/systemd/releases/tag/v245-rc1
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.