DH_SYSUSER(1) | User Contributed Perl Documentation | DH_SYSUSER(1) |
dh_sysuser - manage system users required for package operation
dh_sysuser [debhelper options] [username options] ...
dh_sysuser is a debhelper addon providing a simple and uniform way to create and remove system users required for package operation (for example, to run a service with dropped privileges).
The user creation itself is delegated to useradd(8) utility, the behavior of which is controlled by /etc/login.defs configuration file. In the default installation:
WARNING: The data stored in new user's home directory are world-readable. If you (as package maintainer) need full control over home directory permissions, please file a bug.
dh_sysuser reads its arguments from command line and the debian/package.sysuser file, if one exists, in pairs, the first argument being a username and the second one is options. The configuration file or command-line arguments must be used to create users: just calling dh_sysuser without any arguments does not have any effect.
Here are the options that can be specified after the username:
Creating a system user (or a user in general) is easy, but safely removing one is hard. There is no consensus on what should happen to its home directory or files owned by the user elsewhere.
There was some discussion (#848239, #848240), but there is still no simple and definitive answer to that. Therefore dh-sysuser does the following on package removal:
NOTE: As a package maintainer, you are encouraged to delete files from home directories known to be of little value. It increases chances that home directory becomes empty and user is removed.
In debian/package.sysuser, this creates a user foo with defaults settings, with a home directory at the default location for bar, and a home directory at a custom location for baz:
foo defaults bar home baz home=/opt/baz
2023-02-24 | perl v5.36.0 |