systemd: drop _ prefix from username

man 5 sysuses.d recommends:
It is strongly recommended to pick user and group names that are unlikely to clash with normal users created by the administrator.
A good scheme to guarantee this is by prefixing all system and group names with the underscore, and avoiding too generic names.

Looks better without underscore. wesnoth is unique enough to not clash, most daemons on Arch don't have an underscore either.

The group is created implicitely when the user is created.
This commit is contained in:
Severin Glöckner 2024-01-17 16:13:00 +01:00
parent 6b328bfef8
commit 8b6ef6aeeb
5 changed files with 5 additions and 8 deletions

View file

@ -1,2 +1,2 @@
### Security Fixes
* Run wesnothd server as `_wesnoth:_wesnoth` instead of `nobody:users`, improving safety and fixing a warning message in systemd 246+
* Run wesnothd server as `wesnoth:wesnoth` instead of `nobody:users`, improving safety and fixing a warning message in systemd 246+

View file

@ -23,8 +23,7 @@ ExecStopPost=/bin/rm -f @FIFO_DIR@/socket
SyslogIdentifier=Wesnothd@BINARY_SUFFIX@
WorkingDirectory=@FIFO_DIR@
User=_wesnoth
Group=_wesnoth
User=wesnoth
# Additional security-related features
# (when using the -c option, do not use ProtectHome)

View file

@ -4,8 +4,7 @@ After=network.target
[Service]
ExecStart=%bindir/wesnothd
User=_wesnoth
Group=_wesnoth
User=wesnoth
[Install]
WantedBy=multi-user.target

View file

@ -1,2 +1 @@
u _wesnoth -
g _wesnoth -
u wesnoth - "Wesnoth multiplayer server"

View file

@ -1 +1 @@
d @FIFO_DIR@ 0700 _wesnoth _wesnoth -
d @FIFO_DIR@ 0700 wesnoth wesnoth -