Code Monkey home page Code Monkey logo

Comments (1)

vitaliy-guliy avatar vitaliy-guliy commented on August 19, 2024

At the moment we have some issues when trying to use and configure SSH server inside a container.
I tried to use Open SSH and the alternative Dropbear.

The current state of the attempts to configure both services is in the draft pull request che-incubator/che-code#327

The main problem that I see at the moment that is user in the container is not properly configured (seems not properly configured). Open SSH require PAM to be properly configured. But all the changes made in developer container were overwritten by the kubernetes when workspace startup.

Alternative Dropear service is not very talkative and do not explain in the details the reason of failure.
It says only, that user user is wrong

Login attempt with wrong user user from 127.0.0.1:34192

Third option I have tried is to build the image based on ubuntu.

FROM ubuntu:16.04
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
# Set root password for SSH access (change 'your_password' to your desired password)
RUN echo 'root:your_password' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

It is possible to test how does it work, but locally, not in the container

  • Download and launch the service
docker pull quay.io/vgulyy/ssh-ubuntu:test
docker run --name ssh-ubuntu quay.io/vgulyy/ssh-ubuntu:test
  • Take the IP address
sudo docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ssh-ubuntu
  • Connect to the service

But it does not work if create a container with this image, because of configuration files are overwritten.

from che.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.