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

Works but issues errors #57

Open
DsAtHuH opened this issue Feb 12, 2022 · 0 comments
Open

Works but issues errors #57

DsAtHuH opened this issue Feb 12, 2022 · 0 comments

Comments

@DsAtHuH
Copy link

DsAtHuH commented Feb 12, 2022

Configuration

Docker-compose file

I am using a docker-compose.yml file in the project root folder as follows:

version: '3.7'

services:
    ssh:
      container_name: ssh
      depends_on:
        - my-container
      image: jeroenpeeters/docker-ssh
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - /usr/bin/docker:/usr/bin/docker
        - shared_volume:/.ssh
      environment:
        - FILTERS={"name":["^/my-container$$"]}
        - AUTH_MECHANISM=publicKey
        - AUTHORIZED_KEYS=/.ssh/authorized_keys
      ports:
        - 2222:22
        - 8022:8022
    my-container:
      container_name: my-container
      build:
        context: .
        args:
          SSH_PUBLIC_KEY: ${SSH_PUBLIC_KEY}
      restart: always
      volumes:
        - shared_volume:/var/.ssh
volumes:
    shared_volume:

Dockefile

I am also using a Dockerfile file in the project root folder:

FROM IMAGE:VERSION
ARG SSH_PUBLIC_KEY
# declare a volume at location /var/.ssh
RUN mkdir /var/.ssh
RUN echo "$SSH_PUBLIC_KEY" > /var/.ssh/authorized_keys
VOLUME /var/.ssh

EXPOSE 22
CMD bash

Behaviour

I works when opening through the browser and URL rendering the following characters in the terminal within the browser:

Connection established                                                                                           
                                                                                                                 
 ###############################################################                                                 
 ## Docker SSH ~ Because every container should be accessible ##                                                 
 ###############################################################                                                 
 ## container | /my-container                                 ##                                                 
 ###############################################################

The Errors

When accessing through the browser and URL localhost:8022:

When connecting to port 8022 through browser it works but issues the following error within the ssh container:

TypeError: Cannot read property 'session:window-change' of undefined
  at /usr/src/app/src/webserver.coffee:66:33
  at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
  at next (/usr/src/app/node_modules/express/lib/router/route.js:131:13)
  at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
  at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
  at /usr/src/app/node_modules/express/lib/router/index.js:277:22
  at param (/usr/src/app/node_modules/express/lib/router/index.js:349:14)
  at param (/usr/src/app/node_modules/express/lib/router/index.js:365:14)
  at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:410:3)
  at next (/usr/src/app/node_modules/express/lib/router/index.js:271:10)
  at /usr/src/app/node_modules/body-parser/lib/read.js:129:5
  at invokeCallback (/usr/src/app/node_modules/raw-body/index.js:262:16)
  at done (/usr/src/app/node_modules/raw-body/index.js:251:7)
  at IncomingMessage.onEnd (/usr/src/app/node_modules/raw-body/index.js:307:7)
  at emitNone (events.js:86:13)
  at IncomingMessage.emit (events.js:185:7)
  at endReadableNT (_stream_readable.js:974:12)
  at _combinedTickCallback (internal/process/next_tick.js:80:11)
  at process._tickCallback (internal/process/next_tick.js:104:9)

When trying to access through ssh:

I am using the command ssh -oKexAlgorithms=+curve25519-sha256 -i ~/.ssh/id_ed25519 root@localhost -p 2222 -vvv which results in:

Unable to negotiate with 127.0.0.1 port 2222: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant