You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] USER_NAME=b falsely matches 'bin' user due to loose grep pattern #118
Setting USER_NAME=b causes the container to fail with:
*** USER_NAME cannot be set to an user that already exists in /etc/passwd. Halting init. ***
However, there is no user b in /etc/passwd. The init script appears to use a loose pattern match (e.g., grep "^b") which incorrectly matches the bin user.
Expected Behavior
Short usernames like b should work if they don't exactly match an existing username. The check should use exact matching, e.g.:
grep "^${USER_NAME}:" /etc/passwd
instead of:
grep "^${USER_NAME}" /etc/passwd
Steps To Reproduce
Run container with USER_NAME=b:
docker run --rm -e USER_NAME=b -e PUBLIC_KEY="ssh-ed25519 AAAA..." lscr.io/linuxserver/openssh-server:latest
Observe error: USER_NAME cannot be set to an user that already exists
Verify b doesn't exist:
docker run --rm lscr.io/linuxserver/openssh-server:latest cat /etc/passwd | grep "^b:"# No output - user 'b' does not exist
The bin user exists and starts with 'b', causing false positive:
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
github-actions commentedon Jan 21, 2026
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
fix: use exact match for USER_NAME in /etc/passwd check
LinuxServer-CI commentedon Feb 21, 2026
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
brendandebeasi commentedon Feb 21, 2026
@LinuxServer-CI is there something else I am supposed to do here?
brendandebeasi commentedon Feb 21, 2026
@thespad is this PR waiting on something for me? Not sure why the bot marked it as stale.
fix: use exact match for USER_NAME in /etc/passwd check