[Bug] Non-system headscale user and group from DEB packages #876

Closed
opened 2025-12-29 02:25:08 +01:00 by adam · 2 comments
Owner

Originally created by @maxlysenko on GitHub (Dec 11, 2024).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

DEB packages from v0.23.0 release create non-system user and group with /home/headscale home dir and /bin/sh shell.

Expected Behavior

Creating system user and system group with /var/lib/headscale home dir and /usr/sbin/nologin shell.
Similar to the way described in thedocumentation for installation from official standalone binaries

sudo useradd \
 --create-home \
 --home-dir /var/lib/headscale/ \
 --system \
 --user-group \
 --shell /usr/sbin/nologin \
 headscale

Steps To Reproduce

Install v0.23.0 using DEB package from the GitHub releases page on a system where no headscale user and group exists.

Environment

- OS: Ubuntu 22.04
- Headscale version: 0.23.0
- Tailscale version:

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

I see that postinstall.sh was updated in #2134 after release of v0.23.0 with fixes for home dir and shell, but maybe it still makes sense to create system user and system group?
E.g. by adding -r option for useradd and groupadd and adding -S option for Alpine's addgroup, like

useradd -r -s "$HEADSCALE_SHELL" -d "$HEADSCALE_HOME_DIR" -c "headscale default user" "$HEADSCALE_USER"
groupadd -r "$HEADSCALE_GROUP"
addgroup -S "$HEADSCALE_GROUP"
Originally created by @maxlysenko on GitHub (Dec 11, 2024). ### Is this a support request? - [X] This is not a support request ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior DEB packages from v0.23.0 release create non-system user and group with `/home/headscale` home dir and `/bin/sh` shell. ### Expected Behavior Creating system user and system group with `/var/lib/headscale` home dir and `/usr/sbin/nologin` shell. Similar to the way described in the[documentation](https://headscale.net/stable/setup/install/official/#using-standalone-binaries-advanced) for installation from official standalone binaries ```shell sudo useradd \ --create-home \ --home-dir /var/lib/headscale/ \ --system \ --user-group \ --shell /usr/sbin/nologin \ headscale ``` ### Steps To Reproduce Install v0.23.0 using DEB package from the [GitHub releases page](https://github.com/juanfont/headscale/releases/tag/v0.23.0) on a system where no headscale user and group exists. ### Environment ```markdown - OS: Ubuntu 22.04 - Headscale version: 0.23.0 - Tailscale version: ``` ### Runtime environment - [ ] Headscale is behind a (reverse) proxy - [ ] Headscale runs in a container ### Anything else? I see that [postinstall.sh](https://github.com/juanfont/headscale/blob/main/docs/packaging/postinstall.sh) was updated in #2134 after release of v0.23.0 with fixes for home dir and shell, but maybe it still makes sense to create system user and system group? E.g. by adding `-r` option for `useradd` and `groupadd` and adding `-S` option for Alpine's `addgroup`, like ```shell useradd -r -s "$HEADSCALE_SHELL" -d "$HEADSCALE_HOME_DIR" -c "headscale default user" "$HEADSCALE_USER" groupadd -r "$HEADSCALE_GROUP" addgroup -S "$HEADSCALE_GROUP" ```
adam added the stalebug labels 2025-12-29 02:25:08 +01:00
adam closed this issue 2025-12-29 02:25:08 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Apr 4, 2025):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Apr 4, 2025): This issue is stale because it has been open for 90 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 11, 2025):

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions[bot] commented on GitHub (Apr 11, 2025): This issue was closed because it has been inactive for 14 days since being marked as stale.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#876