-
-
Notifications
You must be signed in to change notification settings - Fork 188
Open
Description
Current Behavior
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/passwdinstead of:
grep "^${USER_NAME}" /etc/passwdSteps 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
bdoesn't exist:
docker run --rm lscr.io/linuxserver/openssh-server:latest cat /etc/passwd | grep "^b:"
# No output - user 'b' does not exist- The
binuser exists and starts with 'b', causing false positive:
bin:x:1:1:bin:/bin:/sbin/nologin
CPU Architecture
x86-64
Docker Creation
docker run -d \
-e PUID=1000 \
-e PGID=1000 \
-e USER_NAME=b \
-e PUBLIC_KEY="ssh-ed25519 AAAA..." \
-p 2222:2222 \
lscr.io/linuxserver/openssh-server:latestContainer Logs
[migrations] started
[migrations] no migrations found
*** USER_NAME cannot be set to an user that already exists in /etc/passwd. Halting init. ***
Environment
- OS: Ubuntu 22.04 on Dokploy
- Docker: Docker Swarm mode
- Image version: 10.2_p1-r0-ls213
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Issues