LinuxCommandLibrary

homectl

TLDR

List user accounts and home directories

$ homectl list
copy
Create a user account and home directory
$ sudo homectl create [username]
copy
Remove a user and associated home directory
$ sudo homectl remove [username]
copy
Change password for a user
$ sudo homectl passwd [username]
copy
Run a shell or command with access to a specific home
$ sudo homectl with [username] -- [command]
copy
Lock or unlock a home directory
$ sudo homectl lock [username]
copy
Change disk space assigned to a home directory
$ sudo homectl resize [username] 100G
copy
Display help
$ homectl -h
copy

SYNOPSIS

homectl [command] [options] [user]

DESCRIPTION

homectl manages user accounts and home directories via systemd-homed, a systemd service that provides portable, encrypted home directories.
systemd-homed stores user accounts as self-contained records with their home directories. Home directories can be encrypted (LUKS), enabling security features like automatic locking on suspend and portable home directories that can be moved between machines.
Features include:
- Encrypted home directories
- Automatic locking on suspend/idle
- Disk quota management
- Portable home directories

PARAMETERS

list

List managed home directories
create USER
Create new user with home directory
remove USER
Remove user and home directory
passwd USER
Change user password
with USER -- CMD
Run command with access to user's home
lock USER
Lock home directory (deactivate)
unlock USER
Unlock home directory (activate)
resize USER SIZE
Change home directory size
inspect USER
Show user record details
update USER
Update user properties
--storage=TYPE
Storage type: luks, directory, subvolume, fscrypt, cifs

CAVEATS

Requires systemd-homed service. Not compatible with traditional /etc/passwd management. Some services may not work correctly with homed users. LUKS homes require unlocking at login.

HISTORY

homectl and systemd-homed were introduced in systemd 245 (2020) by Lennart Poettering. They represent a modern approach to Linux user management with built-in encryption and portability features.

SEE ALSO

Copied to clipboard