Converting Existing Users to systemd-homed

https://news.ycombinator.com/rss Hits: 4
Summary

Traditionally on most Linux distributions, regular (human) users are managed via entries in /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow. With the advent of systemd-homed it might be desirable to convert an existing, traditional user account to a systemd-homed managed one. Below is a brief guide how to do that. This is a manual process, and possibly a bit fragile. Hence, do this at your own risk, read up beforehand, and make a backup first. You know what’s at stake: your own home directory, i.e. all your personal data. Preparations: make sure you run a distribution that has systemd-homed enabled and properly set up, including the necessary PAM and NSS configuration updates. Make sure you have enough disk space in /home/ for a (temporary) second copy of your home directory. Make sure to backup your home directory. Make sure to log out of your user account fully. Then log in as root on the console. Rename your existing home directory to something safe. Let’s say your user ID is foobar. Then do: mv /home/foobar /home/foobar.saved Have a look at your existing user record, as stored in /etc/passwd and related files. We want to use the same data for the new record, hence it’s good looking at the old data. Use commands such as: getent passwd foobar getent shadow foobar This will tell you the /etc/passwd and /etc/shadow entries for your user. For details about the fields, see the respective man pages passwd(5) and shadow(5). The fourth field in the getent passwd foobar output tells you the GID of your user’s main group. Depending on your distribution it’s a group private to the user, or a group shared by most local, regular users. Let’s say the GID reported is 1000, let’s then query its details: This will tell you the name of that group. If the name is the same as your user name your distribution apparently provided you with a private group for your user. If it doesn’t match (and is something like users) it apparently didn’t. Note that systemd-homed will always man...

First seen: 2025-08-06 22:20

Last seen: 2025-08-07 01:20