Nologin is on a different path in Debian and derivatives #410

Closed
opened 2025-12-29 01:28:32 +01:00 by adam · 2 comments
Owner

Originally created by @murtezayesil on GitHub (Jan 17, 2023).

nologin is at /usr/sbin/nologin in Debian/Ubuntu and their derivatives. Running the code for creating a headscale user without knowing requires us to later editing /etc/passwd which is never advised to edit directly.

Please add a note for Debian/Ubuntu in 3rd step for Running Headscale on Linux.

Here is an example:

Debian/Ubuntu users should run
   useradd \
	--create-home \
	--home-dir /var/lib/headscale/ \
	--system \
	--user-group \
	--shell /usr/sbin/nologin \
	headscale

Here is how the example is implemented:

<details><summary>❗Debian/Ubuntu users should run</summary>

<code>
   useradd \
	--create-home \
	--home-dir /var/lib/headscale/ \
	--system \
	--user-group \
	--shell /usr/sbin/nologin \
	headscale
</code>
</details>

Thanks and have a great day.

Originally created by @murtezayesil on GitHub (Jan 17, 2023). `nologin` is at `/usr/sbin/nologin` in Debian/Ubuntu and their derivatives. Running the code for creating a headscale user without knowing requires us to later editing `/etc/passwd` which is never advised to edit directly. Please add a note for Debian/Ubuntu in 3rd step for Running Headscale on Linux. Here is an example: <details><summary>❗Debian/Ubuntu users should run</summary> ```bash useradd \ --create-home \ --home-dir /var/lib/headscale/ \ --system \ --user-group \ --shell /usr/sbin/nologin \ headscale ``` </details> Here is how the example is implemented: ``` <details><summary>❗Debian/Ubuntu users should run</summary> <code> useradd \ --create-home \ --home-dir /var/lib/headscale/ \ --system \ --user-group \ --shell /usr/sbin/nologin \ headscale </code> </details> ``` Thanks and have a great day.
adam closed this issue 2025-12-29 01:28:32 +01:00
Author
Owner

@katanacrimson commented on GitHub (Jan 17, 2023):

/sbin is retained as a symlink on Debian 11 and I believe the same is on Ubuntu 22.04; not sure about Ubuntu 22.10, I don't have a deployment of that anywhere.

Is there any indication that Debian and its derivatives are dropping the symlink anytime soon? If not, this isn't an issue, as specifying a symlinked location as the shell for a user still works as expected; you can test this with sudo -iu $username when the shell is set to /sbin/nologin.

@katanacrimson commented on GitHub (Jan 17, 2023): `/sbin` is retained as a symlink on Debian 11 and I believe the same is on Ubuntu 22.04; not sure about Ubuntu 22.10, I don't have a deployment of that anywhere. Is there any indication that Debian and its derivatives are dropping the symlink anytime soon? If not, this isn't an issue, as specifying a symlinked location as the shell for a user still works as expected; you can test this with `sudo -iu $username` when the shell is set to `/sbin/nologin`.
Author
Owner

@murtezayesil commented on GitHub (Feb 2, 2023):

In my recent try, I had some trouble during installation. After checking what could be the culprit, I landed on there being 2 paths for nologin. I was wrong. Have a great day.

@murtezayesil commented on GitHub (Feb 2, 2023): In my recent try, I had some trouble during installation. After checking what could be the culprit, I landed on there being 2 paths for nologin. I was wrong. Have a great day.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#410