Skip to content

[BUG] Can't SSH into container #108

@katelovescode

Description

@katelovescode

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Error:

> ssh [email protected] -i config/.ssh/id_ed25519 -p 2222
The authenticity of host '[192.168.52.115]:2222 ([192.168.52.115]:2222)' can't be established.
ED25519 key fingerprint is ----.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[192.168.52.115]:2222' (ED25519) to the list of known hosts.
[email protected]: Permission denied (publickey,keyboard-interactive).

Expected Behavior

SSH should work

Steps To Reproduce

  • Erase known_hosts record and config local volume for this container (from previous attempts)
  • docker compose up
  • docker exec -it openssh-server /bin/bash
  • su dmt
  • ssh-keygen
  • save file to /config/.ssh/id_ed25519 when prompted
  • exit shell
  • try to ssh with ssh [email protected] -i config/.ssh/id_ed25519 -p 2222

Environment

- OS: MacOS
- How docker service was installed: brew install --cask docker

CPU architecture

arm64

Docker creation

docker-compose.yml

---
services:
  openssh-server:
    image: lscr.io/linuxserver/openssh-server:latest
    container_name: openssh-server
    hostname: openssh-server
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - PUBLIC_KEY_FILE=config/.ssh/id_ed25519.pub #optional
      - USER_NAME=dmt
    volumes:
      - ./config:/config
    ports:
      - 2222:2222
    restart: unless-stopped

-----

docker compose up

Container logs

docker compose up
[+] Running 2/2
 ✔ Network mock_ssh_server_default  Created                                                                                                                                                                      0.0s
 ✔ Container openssh-server         Created                                                                                                                                                                      0.0s
Attaching to openssh-server
openssh-server  | [migrations] started
openssh-server  | [migrations] no migrations found
openssh-server  | ───────────────────────────────────────
openssh-server  |
openssh-server  |       ██╗     ███████╗██╗ ██████╗
openssh-server  |       ██║     ██╔════╝██║██╔═══██╗
openssh-server  |       ██║     ███████╗██║██║   ██║
openssh-server  |       ██║     ╚════██║██║██║   ██║
openssh-server  |       ███████╗███████║██║╚██████╔╝
openssh-server  |       ╚══════╝╚══════╝╚═╝ ╚═════╝
openssh-server  |
openssh-server  |    Brought to you by linuxserver.io
openssh-server  | ───────────────────────────────────────
openssh-server  |
openssh-server  | To support LSIO projects visit:
openssh-server  | https://www.linuxserver.io/donate/
openssh-server  |
openssh-server  | ───────────────────────────────────────
openssh-server  | GID/UID
openssh-server  | ───────────────────────────────────────
openssh-server  |
openssh-server  | User UID:    1000
openssh-server  | User GID:    1000
openssh-server  | ───────────────────────────────────────
openssh-server  | Linuxserver.io version: 9.9_p2-r0-ls193
openssh-server  | Build-date: 2025-02-18T21:25:39+00:00
openssh-server  | ───────────────────────────────────────
openssh-server  |
openssh-server  | User name is set to dmt
openssh-server  | sudo is disabled.
openssh-server  | ssh-keygen: generating new host keys: RSA ECDSA ED25519
openssh-server  | SSH host public key(s):
openssh-server  | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGc4nB/7U0UddJ5HcJ700/Bp8wNeRk6nHQR3zV5mXmPqUQ0Hto2CFABGSnAcLSt/GJ0s+YXvwdjN4sss2hmaND0= root@openssh-server
openssh-server  | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILbA1LFWP5F03AaV/e4OHQo4HwuvQj24iJXHP9poI2JO root@openssh-server
openssh-server  | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCr+UkVohY6sDrRTWYrw5KmhoyQYHFGEUzyuXmXkdv+/dIlQ5RttFeXn1t5WJj7PpLdijgE7fNUvGlJof3SDNEYyC359f4ylK9SkrduHER6XUcww/+E7HWez6HUmu7/gTlEKAtqdDRtMEImj7WTRJG7wFJrDNuChplg/0eHiky+TemrVxnU9KAv4Pn7kl5WVNnQNsrv3MK/pW3+WiNTyM6st3JKjTzfOz4zd+tlktbp0HkoUWvyePFVJaqCYFK/+pxiSXeT9Jqe08fEyQPL74cAqfd8Kjv3yWJ+/8BOgAEyUCzjsctYZPTzAxfai8qLrsoezQtswPMopxt54yvLX1hFFP3jzcuOlmPvSixFvFISBILTB1TNBEsRN/7pq+rar1xh5+3LeSwNrxsRe5Qn9maXugbsPlHxyaS5sbvM8X7qRJ/W9mphegjCDVUgDiDrBzPKIkifMPu7a3FQNPwmwBdMLYb6TIQwpxiqnd3tOSUnA6MicdIxxBhWRPYbGQIJw98= root@openssh-server
openssh-server  | sshd is listening on port 2222
openssh-server  | User/password ssh access is disabled.
openssh-server  | [custom-init] No custom files found, skipping...
openssh-server  | [ls.io-init] done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions