-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] confusing init-adduser behavior when picking a USER_NAME which collides with system user #93
Comments
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid. |
i have a similar problem with system user, i need use 'www-data' system user, but server not starting and change user gid: docker compose:
Docker Log:
if i try use another PGID & PUID working but server not accept key: Docker Compose:
Docker Log:
SSH Login:
SSH Server Log:
|
So the TL;DR is that as www-data is an existing group we can't rename the abc group to that name, so it ends up changing the abc GID to 1001 and assigning that to the user instead. It might be possible to change things so that in those cases where it's not an existing user but is an existing group we can handle it with a usermod -g. Can you open a new issue with your details and I'll try and find time to take a look at it. |
in the second example, where it works because it doesn't recognize the key and continues to give access denied? |
Not sure, should be looking at the same authorized_keys list in both cases. Though FWIW in your use case you probably don't need to use |
then I open a new ticket, docker compose:
container log:
list of ssh keys:
rsa key pub:
ssh login:
openssh-server log:
|
solved after several tests, now it seems to work but with username/password, using the key it doesn't work this way you have read and write permissions like www-data:www-data (33:33) and in the main server the files appear with the correct permissions docker compose:
container log:
/etc/passwd file:
|
Where? open a new issue, https://github.com/linuxserver/docker-openssh-server/issues/new/choose |
Today I publish the new request with all the information about it, also with the solution found to the problem |
Is there an existing issue for this?
Current Behavior
When specifying a USER_NAME and this user exists already (e.g. listed in
/etc/passwd
)usermod
fails with an error andauthorized_keys
is looked up from/sbin
Currently this log is all that is present to signify there is an issue
usermod: user 'sync' already exists
I missed this log initially and only saw it once I found the issue after looking at the ssh debug logs.
Expected Behavior
An error should be raised and the container should exit
Steps To Reproduce
Set
USER_NAME
to one of these users (I was usingsync
which was producing the error)Environment
CPU architecture
x86-64
Docker creation
docker compose up with SYNC_SSH_PUBLIC_KEY and SYNC_SSH_PUBLIC_KEY set in env
Container logs
and the debug log that led me to understand what was happening
The text was updated successfully, but these errors were encountered: