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] Connection refused in 9.7_p1-r4-ls176 #101

Closed
1 task done
shizunge opened this issue Nov 27, 2024 · 4 comments
Closed
1 task done

[BUG] Connection refused in 9.7_p1-r4-ls176 #101

shizunge opened this issue Nov 27, 2024 · 4 comments

Comments

@shizunge
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

In 9.7_p1-r4-ls176, I get a connection refused error. Rolling back to ls175 worked.

I saw the following errors in ls176 log. I don't see such errors with ls175. I think it could be related.

2024-11-26 23:48:36.467	
chmod: cannot access '/config/sshd/sshd_config/ssh_host_*_key.pub': Not a directory
2024-11-26 23:48:36.456	
chmod: cannot access '/config/sshd/sshd_config/ssh_host_*_key': Not a directory

My setup (via docker):

    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - PUBLIC_KEY_FILE=/authorized_keys
      - SUDO_ACCESS=false #optional
      - PASSWORD_ACCESS=false #optional
      - USER_NAME=${USER_NAME} #optional

I provided /authorized_key via docker secrets and set the mode to 0600.

Expected Behavior

Connection accepted as ls175

Steps To Reproduce

Start ssh-server and try to connect it using a ssh-key.

Environment

- OS: Ubuntu 24
- Docker 27.3.1

CPU architecture

x86-64

Docker creation

server:
    image: lscr.io/linuxserver/openssh-server
    hostname: "ssh-{{.Node.Hostname}}"
    dns:
      - 1.1.1.1
    env_file:
      - ./env-global.env
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - PUBLIC_KEY_FILE=/authorized_keys
      - SUDO_ACCESS=false #optional
      - PASSWORD_ACCESS=false #optional
      - USER_NAME=${USER_NAME} #optional
    secrets:
      - source: ed25519-key
        target: /config/.ssh/id_ed25519
        uid: ${PUID}
        gid: ${PGID}
        mode: 0600
      - source: ed25519-key-pub
        target: /config/.ssh/id_ed25519.pub
        uid: ${PUID}
        gid: ${PGID}
        mode: 0600
      - source: middle-key-pub
        target: /authorized_keys
        uid: ${PUID}
        gid: ${PGID}
        mode: 0600
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${VOLUME_PATH}/data/ssh:/config
    deploy:
      replicas: 1


### Container logs

```bash
2024-11-26 23:48:35.034	[migrations] started
2024-11-26 23:48:35.034	[migrations] no migrations found
2024-11-26 23:48:35.369	───────────────────────────────────────
2024-11-26 23:48:35.370	
2024-11-26 23:48:35.370	      ██╗     ███████╗██╗ ██████╗
2024-11-26 23:48:35.370	      ██║     ██╔════╝██║██╔═══██╗
2024-11-26 23:48:35.370	      ██║     ███████╗██║██║   ██║
2024-11-26 23:48:35.370	      ██║     ╚════██║██║██║   ██║
2024-11-26 23:48:35.370	      ███████╗███████║██║╚██████╔╝
2024-11-26 23:48:35.371	      ╚══════╝╚══════╝╚═╝ ╚═════╝
2024-11-26 23:48:35.371	
2024-11-26 23:48:35.371	   Brought to you by linuxserver.io
2024-11-26 23:48:35.371	───────────────────────────────────────
2024-11-26 23:48:35.371	
2024-11-26 23:48:35.371	To support LSIO projects visit:
2024-11-26 23:48:35.371	https://www.linuxserver.io/donate/
2024-11-26 23:48:35.371	
2024-11-26 23:48:35.371	───────────────────────────────────────
2024-11-26 23:48:35.371	GID/UID
2024-11-26 23:48:35.371	───────────────────────────────────────
2024-11-26 23:48:35.448	
2024-11-26 23:48:35.448	User UID:    1000
2024-11-26 23:48:35.448	User GID:    1000
2024-11-26 23:48:35.448	───────────────────────────────────────
2024-11-26 23:48:35.452	Linuxserver.io version: 9.7_p1-r4-ls176
2024-11-26 23:48:35.452	Build-date: 2024-11-26T21:01:46+00:00
2024-11-26 23:48:35.452	───────────────────────────────────────
2024-11-26 23:48:35.452	    
2024-11-26 23:48:35.857	User name is set to shizun
2024-11-26 23:48:35.857	sudo is disabled.
2024-11-26 23:48:36.456	chmod: cannot access '/config/sshd/sshd_config/ssh_host_*_key': Not a directory
2024-11-26 23:48:36.467	chmod: cannot access '/config/sshd/sshd_config/ssh_host_*_key.pub': Not a directory
2024-11-26 23:48:36.470	SSH host public key(s):
2024-11-26 23:48:36.479	ssh-dss 
2024-11-26 23:48:36.482	ecdsa-sha2-nistp256 
2024-11-26 23:48:36.482	ssh-ed25519 
2024-11-26 23:48:36.483	ssh-rsa 
2024-11-26 23:48:36.667	sshd is listening on port 2222
2024-11-26 23:48:36.695	User/password ssh access is disabled.
2024-11-26 23:48:36.946	[custom-init] No custom files found, skipping...

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

The chmod errors are due to a typo, I've pushed a fix to master. Once it's built (probably 9.7_p1-r4-ls177) can you update and retest. If you still have issues can you also provide your logfile from /config/log/openssh/current.

@shizunge
Copy link
Author

Seems working with newer release.

@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Nov 27, 2024
@shizunge
Copy link
Author

Do we have regression coverage on this?

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