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] Public key files from PUBLIC_KEY_DIR does not get imported #80

Closed
1 task done
k4ffee opened this issue Jan 4, 2024 · 3 comments
Closed
1 task done

[BUG] Public key files from PUBLIC_KEY_DIR does not get imported #80

k4ffee opened this issue Jan 4, 2024 · 3 comments

Comments

@k4ffee
Copy link

k4ffee commented Jan 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

/config/.ssh/authorized_keys file get created, but stays empty

Expected Behavior

See public keys from PUBLIC_KEY_DIR in /config/.ssh/authorized_keys

Steps To Reproduce

add path to PUBLIC_KEY_DIR, run docker compose up

Environment

- OS: debian 12.4
- How docker service was installed: official way from docker https://docs.docker.com/engine/install/debian/


root@kosh:/srv/docker/lgsm-vh# ls -la
total 16
drwxr-xr-x 3 root root 4096 Jan  4 20:26 .
drwxr-xr-x 8 root root 4096 Jan  3 19:07 ..
-rw-r--r-- 1 root root  653 Jan  4 20:24 compose.yml
drwxr-xr-x 2 root root 4096 Jan  4 19:53 public_keys
root@kosh:/srv/docker/lgsm-vh# ls -la *
-rw-r--r-- 1 root root  653 Jan  4 20:24 compose.yml

public_keys:
total 12
drwxr-xr-x 2 root root 4096 Jan  4 19:53 .
drwxr-xr-x 3 root root 4096 Jan  4 20:26 ..
-rw-r--r-- 1 root root  396 Jan  4 19:53 michael_plauze.pub


### CPU architecture

x86-64

### Docker creation

```bash
version: "1.0"

volumes:
  vh-data:
    labels:
      - "com.docker.compose.volume.user=username:username" 
services:
  vh-openssh:
    image: linuxserver/openssh-server
    restart: unless-stopped
    volumes:
      - vh-data:/config

    environment:
      - PUBLIC_KEY_DIR=/srv/docker/lgsm-vh/public_keys
      - USER_NAME=username
      - LOG_STDOUT=true
      - TZ=Europe/Berlin
      - PUID=1000
      - PGID=1000

    ports:
      - 12345:2222

Container logs

Attaching to lgsm-vh-vh-openssh-1
lgsm-vh-vh-openssh-1  | [migrations] started
lgsm-vh-vh-openssh-1  | [migrations] no migrations found
lgsm-vh-vh-openssh-1  | ───────────────────────────────────────
lgsm-vh-vh-openssh-1  | 
lgsm-vh-vh-openssh-1  |       ██╗     ███████╗██╗ ██████╗ 
lgsm-vh-vh-openssh-1  |       ██║     ██╔════╝██║██╔═══██╗
lgsm-vh-vh-openssh-1  |       ██║     ███████╗██║██║   ██║
lgsm-vh-vh-openssh-1  |       ██║     ╚════██║██║██║   ██║
lgsm-vh-vh-openssh-1  |       ███████╗███████║██║╚██████╔╝
lgsm-vh-vh-openssh-1  |       ╚══════╝╚══════╝╚═╝ ╚═════╝ 
lgsm-vh-vh-openssh-1  | 
lgsm-vh-vh-openssh-1  |    Brought to you by linuxserver.io
lgsm-vh-vh-openssh-1  | ───────────────────────────────────────
lgsm-vh-vh-openssh-1  | 
lgsm-vh-vh-openssh-1  | To support LSIO projects visit:
lgsm-vh-vh-openssh-1  | https://www.linuxserver.io/donate/
lgsm-vh-vh-openssh-1  | 
lgsm-vh-vh-openssh-1  | ───────────────────────────────────────
lgsm-vh-vh-openssh-1  | GID/UID
lgsm-vh-vh-openssh-1  | ───────────────────────────────────────
lgsm-vh-vh-openssh-1  | 
lgsm-vh-vh-openssh-1  | User UID:    1000
lgsm-vh-vh-openssh-1  | User GID:    1000
lgsm-vh-vh-openssh-1  | ───────────────────────────────────────
lgsm-vh-vh-openssh-1  | 
lgsm-vh-vh-openssh-1  | User name is set to username
lgsm-vh-vh-openssh-1  | sudo is disabled.
lgsm-vh-vh-openssh-1  | sshd is listening on port 2222
lgsm-vh-vh-openssh-1  | User/password ssh access is disabled.
lgsm-vh-vh-openssh-1  | [custom-init] No custom files found, skipping...
lgsm-vh-vh-openssh-1  | Server listening on 0.0.0.0 port 2222.
lgsm-vh-vh-openssh-1  | Server listening on :: port 2222.
lgsm-vh-vh-openssh-1  | [ls.io-init] done.
lgsm-vh-vh-openssh-1  | kex_exchange_identification: Connection closed by remote host
lgsm-vh-vh-openssh-1  | Connection closed by 127.0.0.1 port 54422
lgsm-vh-vh-openssh-1  | Connection closed by authenticating user linuxgsm 1.2.3.4 port 45734 [preauth]
lgsm-vh-vh-openssh-1  | Connection closed by authenticating user linuxgsm 1.2.3.4 port 38044 [preauth]
Copy link

github-actions bot commented Jan 4, 2024

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

@aptalca
Copy link
Member

aptalca commented Jan 4, 2024

/srv/docker/lgsm-vh/public_keys is not a path accessible inside the container

@k4ffee
Copy link
Author

k4ffee commented Jan 5, 2024

Yes, works. Thank you!

@k4ffee k4ffee closed this as completed Jan 5, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants