Systemd System Manager 256 Released with New Run0 Utility for sudo Replacement

After six months of development presented system manager release systemd 256. Key changes: the run0 utility to replace sudo, the importctl utility for working with disk images, the possibility of versioned access to resources, the concept of capsules for launching additional service managers, the mode of redirecting systemd-journald logs to an arbitrary socket, in systemd-networkd, systemd-machined, bootctl, systemd-creds and systemd-hostnamed, support for the Varlink protocol has been added, the unit generator “systemd-ssh-generator” and the utility “systemd-ssh-proxy” have been proposed.

Among the changes in the new release:

  • The utility is included run0 for executing processes under the identities of other users, which is positioned as a more secure replacement for the sudo program, implemented as an add-on over the command systemd-run. In run0, instead of using SUID, the system manager is asked to start a process, create a new pseudo-terminal (PTY), and transfer data between it and the current terminal (TTY). The privileged process runs in an isolated context, which is spawned by process PID 1 and not by the user process, i.e. does not inherit the properties of the user's environment. Polkit is used to authorize and determine user capabilities. When working with elevated privileges, a red dot indicator is added to the header, and the background tint in the terminal changes to red.
  • Added new command line utility importctlintended for downloading, importing and exporting disk images using the service systemd-importd. importctl implements pull-tar, pull-raw, import-tar, import-raw, import-fs, export-tar, export-raw, list-transfers and cancel-transfer commands, the functionality of which is separated into a separate utility from the program machinectl.
  • Added executable file systemd-vpick with protocol implementation vpick, which provides versioned access to resources such as disk images. Systemd-vpick allows you to load resources from directories “*.v/“, which can store multiple versions of certain files. The version number is indicated in the file name, for example, “mymachine_2.1.5.raw”. If the request does not explicitly specify the version number, the file with the most recent version will be automatically used. Support for versioned loading resources is implemented in the commands “systemd-nspawn –image=/–directory=”, systemd-dissect and systemd-portabled, as well as in the unit settings “RootDirectory=”, “RootImage=”, “ExtensionImages=” and “ExtensionDirectories= “.
  • The concept of capsules has been implemented, allowing you to launch additional separate service managers to manage a group of processes running under temporary users, created dynamically and deleted after the service manager completes its work. Capsules allow you to avoid creating user accounts to run groups of services; they use the home directory “/var/lib/capsules/‹capsule_name>” and a set of standard services. To start the capsule, just run the command “systemctl start capsule@‹name›.service”. To work in the context of capsules, the “–capsule=”/”-C” option has been added to various utilities such as systemctl and systemd-run.
  • systemd-journald has added the ability to redirect a stream of writes to a network or local socket (AF_INET, AF_INET6, AF_UNIX, AF_VSOCK) specified via the ForwardToSocket parameter in journald.conf or via the 'journald.forward_to_socket' property. To limit the sent data to the logging level, the MaxLevelSocket parameter is proposed. To receive logs, the systemd-journal-remote process can be used, which has added support for AF_VSOCK and AF_UNIX sockets.

    Added “–forward-journal” option to systemd-vmspawn to forward logs from the virtual machine to the host environment using the AF_VSOCK socket. systemd-journal-gatewayd has added the ability to limit the time periods in which logs will be received. Added a “-T” (“–exclude-identifier”) option to the journalctl utility to ignore certain syslog identifiers, as well as a “–list-namespaces” option to display a list of available namespaces.

  • Options for integration with sshd have been expanded. Added support for using keys obtained through userdbctl when authorizing incoming connections. A new unit generator “systemd-ssh-generator” has been added, which, if you have an sshd executable file, allows you to configure its activation in relation to various sockets (for example, in containers you can configure an sshd call when accessing port 22 via AF_VSOCK). Added “systemd-ssh-proxy” – a plugin to the ssh utility (enabled via ProxyCommand/ProxyUseFdpass), allowing you to connect via AF_VSOCK and AF_UNIX sockets (for example, you can use ssh instead of sudo to organize local user access to resources).
  • As part of libsystemd's dependency reduction initiative, liblz4, libzstd, liblzma, libkmod, and libgcrypt are dynamically loaded by calling dlopen() in situations where their functionality is actually needed.
  • In addition to the /etc directory, various systemd components now attempt to load the main configuration file from the /usr/lib, /usr/local/lib, and /run directories. For example, systemd-logind will define a configuration file in the following order: /etc/systemd/logind.conf, /run/systemd/logind.conf, /usr/local/lib/systemd/logind.conf and /usr/lib/systemd /logind.conf. systemd-udevd implements overriding the udev.conf file in a similar way.
  • Unprivileged users are given the ability to access encrypted service credentials. To encrypt and decrypt credentials for a specific user, the “–user” and “–uid” options have been added to the systemd-creds utility.
  • Implemented the ability to build systemd from source when disabling all legacy features in OpenSSL 3.0.
  • A setting has been added to the system manager “ProtectSystem=“, which allows you to control the mounting of parts of the FS in read-only mode at the level of the entire system, and not just individual units. By default, the ProtectSystem parameter is activated for the initrd to prohibit writing to the /usr directory during boot.
  • For units, new settings are proposed: “WantsMountsFor=” to define partition mounting as an optional dependency and “MemoryZSwapWriteback=” to control the memory.zswap.write parameter, which appeared in the Linux kernel 6.8. The .mount and .swap units allow the use of fstab-style “What=” identifiers such as “UUID=…” and “LABEL=…”. The “RestrictNetworkInterfaces=” setting allows the use of alternative names for network interfaces.
  • The “MaxConnectionsPerSource=” setting has been added to “.socket” units with the “Accept=yes” option, allowing you to set a limit on the number of simultaneous connections from one IP address or UID (for UNIX sockets).
  • In process”systemd-bsod“, which implements an analogue of the “blue screen of death”, the “–tty” option has been added to select the terminal on which a full-screen notification will be shown in case of critical errors (LOG_EMERG).
  • The /dev directory provides the creation of symbolic links that combine path (by-path) and label (by-{label,uuid}) information: “/dev/disk/by-path/‹path›/by-‹label| uuid|…›/‹label|uuid|…›”, which allows you to allocate identical partitions on different storage devices (for example, after cloning the contents of a disk to another device). For media controllers, systemd-udevd now creates symlinks “/dev/media/by-path/*” (e.g. “/dev/media/by-path/pci-0000:04:00.3-usb-0:1:1.0 -media-controller”).
  • Added systemd-udev-load-credentials.service service for loading udev rules from the credential database.
  • The systemd-networkd and systemd-hostnamed processes implement the interface Varlink. systemd-hostnamed adds support for sending the system ID and loading via D-Bus, as well as all data from the os-release and machine-info files via D-Bus and Varlink. systemd-networkd implements export of NamespaceId and NamespaceNSID properties via D-Bus and Varlink, as well as enumeration of LLDP peers using Varlink-based API.
  • systemd-networkd implements the IPv6RetransmissionTimeSec and UseRetransmissionTime settings to control the retransmission time of NS messages (Neighbor Solicitation) used to determine neighboring IPv6 hosts. Added support for obtaining keys for VPN Wireguard from the credential database. The ReceivePacketSteeringCPUMask parameter has been added to the link files to organize the binding of incoming packet handlers to specific CPUs.
  • Added 'mask' and 'unmask' parameters to the networkctl utility to ignore configuration files (.network). Implemented 'networkctl edit –runtime' command to edit non-persistent configuration in /run/systemd/network/.
  • systemd-nspawn adds support for containerizing network interfaces for Wi-Fi devices.
  • systemd-resolved adds support for Extended DNS Errors (RFC 8914), as well as SVCB, NAPTR, and HTTPS DNS records (RFC 9460, RFC 2915). Added support for the “systemctl reload systemd-resolved” command to reload the configuration without restarting the service.
  • Added 'systemctl edit –stdin' mode, allowing you to create and modify unit files based on content passed through the standard input stream (for example, to create units from scripts).
  • Added 'systemd-analyze architectures' command to list known CPU architectures.
  • Added 'systemd-tmpfiles –purge' command to remove all temporary files and directories created through settings in tmpfiles.d, as well as 'systemd-tmpfiles –dry-run' command to display a log of actions without actually executing them. Added “–clean” option to portablectl to clear all data associated with a portable service (cache, logs, status, runtime data and fdstore) after it is disabled.
  • Added '-j' option to hostnamectl, resolvectl and loginctl for JSON output.
  • The systemd-dissect utility implements the “–make-archive” option to create an archive file (for example, tar.gz) from a disk image.
  • The capabilities for launching virtual machines have been expanded. The following options have been added to the systemd-vmspawn utility, intended for starting virtual machines: “–firmware” to configure the firmware, “–tpm” to enable the software implementation of TPM, “–linux” to specify the bootable kernel, “–initrd” to specify the initrd image, “-D” to specify the root directory, “–private-users” to enable the namespace for users, “–bind=” and “–bind-ro” to forward parts of the FS to their host environment to the guest system, “–extra-drive” to connect additional storage devices, “-n/–network-tap/–network-user-mode” to configure the network, “–console/–background” to select method of interacting with the VM, “–pass-ssh-key/–ssh-key-type” for placing SSH keys in the VM. The “machinectl start” command provides the ability to both start containers via systemd-nspawn and virtual machines via systemd-vmspawn.
  • systemd-homed implements the ability to unlock the user's home directory after logging in via SSH. The “–offline” mode has been added to the homectl utility, allowing you to change account properties without unlocking the home directory.
  • Components for processing disk quotas in the XFS and EXT4 file systems have been redesigned, which made it possible to enable quotas during operation, and not just at the boot stage.
  • Added the MemorySleepMode parameter to the sleep.conf configuration file to configure sleep mode.
  • The varlinkctl utility has added support for the new “ssh:” transport, which can be used with OpenSSH 9.4 and newer releases.
  • The storage time for core dumps has been increased from 3 days to 2 weeks.

Thanks for reading: