Skip to content
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] USER_NAME cannot be set to an user that already exists in /etc/passwd #100

Closed
1 task done
zaubara opened this issue Nov 27, 2024 · 4 comments · Fixed by #102
Closed
1 task done

[BUG] USER_NAME cannot be set to an user that already exists in /etc/passwd #100

zaubara opened this issue Nov 27, 2024 · 4 comments · Fixed by #102
Assignees
Labels
bug Something isn't working

Comments

@zaubara
Copy link

zaubara commented Nov 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

sshd won't start up after the first restart, due to the changes in #97

Expected Behavior

Start.

Steps To Reproduce

Have an empty/non-existent config folder, start it up once, and then restart it for the first time.

Environment

No response

CPU architecture

arm64

Docker creation

services:
  autossh:
    image: linuxserver/openssh-server:latest
    container_name: autossh
    restart: unless-stopped
    ports:
      - 22222:2222
      - 8123:8123
    environment:
      - PUID=1001
      - PGID=1001
      - TZ=Europe/Vienna
      - USER_NAME=randomusername # here's the culprit
      - PASSWORD_ACCESS=false
      - SUDO_ACCESS=false
      - PUBLIC_KEY_FILE=/authorized_keys
    volumes:
      - ./openssh_config:/config
      - ./authorized_keys:/authorized_keys:ro

Container logs

sshd is listening on port 2222
User/password ssh access is disabled.
Public key from file added
[custom-init] No custom files found, skipping...
[ls.io-init] done.
[migrations] started
[migrations] no migrations found
*** USER_NAME cannot be set to an user that already exists in /etc/passwd. Halting init. ***
[migrations] started
[migrations] no migrations found
*** USER_NAME cannot be set to an user that already exists in /etc/passwd. Halting init. ***
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@thespad
Copy link
Member

thespad commented Nov 27, 2024

I can't replicate this, what's the actual username you're using?

autossh  | [migrations] started
autossh  | [migrations] no migrations found
autossh  | ───────────────────────────────────────
autossh  | 
autossh  |       ██╗     ███████╗██╗ ██████╗
autossh  |       ██║     ██╔════╝██║██╔═══██╗
autossh  |       ██║     ███████╗██║██║   ██║
autossh  |       ██║     ╚════██║██║██║   ██║
autossh  |       ███████╗███████║██║╚██████╔╝
autossh  |       ╚══════╝╚══════╝╚═╝ ╚═════╝
autossh  | 
autossh  |    Brought to you by linuxserver.io
autossh  | ───────────────────────────────────────
autossh  | 
autossh  | To support LSIO projects visit:
autossh  | https://www.linuxserver.io/donate/
autossh  | 
autossh  | ───────────────────────────────────────
autossh  | GID/UID
autossh  | ───────────────────────────────────────
autossh  | 
autossh  | User UID:    1001
autossh  | User GID:    1001
autossh  | ───────────────────────────────────────
autossh  | Linuxserver.io version: 9.7_p1-r4-ls176
autossh  | Build-date: 2024-11-26T21:01:46+00:00
autossh  | ───────────────────────────────────────
autossh  |     
autossh  | User name is set to randomusername
autossh  | sudo is disabled.
autossh  | ssh-keygen: generating new host keys: RSA ECDSA ED25519 
autossh  | SSH host public key(s):

@zaubara
Copy link
Author

zaubara commented Nov 27, 2024

"homeassistant", which doesn't seem relevant.
I dont think you started the container a second time, or you'd have another "migrations - started" line at the bottom:

docker logs autossh
[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1001
User GID:    1001
───────────────────────────────────────
Linuxserver.io version: 9.7_p1-r4-ls176
Build-date: 2024-11-26T21:01:46+00:00
───────────────────────────────────────
    
User name is set to homeassistant
sudo is disabled.
ssh-keygen: generating new host keys: RSA ECDSA ED25519 
SSH host public key(s):
ecdsa-sha2-nistp256 ...
ssh-ed25519 ...
ssh-rsa ....
sshd is listening on port 2222
User/password ssh access is disabled.
Public key from file added
[custom-init] No custom files found, skipping...
[ls.io-init] done.
---> here's where i did a restart of the container <---
[migrations] started
[migrations] no migrations found
*** USER_NAME cannot be set to an user that already exists in /etc/passwd. Halting init. ***

@thespad
Copy link
Member

thespad commented Nov 27, 2024

Oh, sorry, didn't notice the restart, yeah I need to fix that. I'll sort out a PR for it later today.

@thespad thespad self-assigned this Nov 27, 2024
@thespad thespad added the bug Something isn't working label Nov 27, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants