Resolved: How to permit SSH connexion to a docker container with complete prompt?

In this post, we will see how to resolve How to permit SSH connexion to a docker container with complete prompt?

Question:

I try to deploy debian containers to allow users to connect to them over SSH (for students for exemple).
I managed to do this but when I am connected to the container I have a pseudo-TTY and it’s not the expected result I want. I want to have a complete interactive shell like when we connect to a reel server or machine.
I tried several ideas like :
  • change the docker add options in my docker run commands like : docker run -d -it CONAINER_ID

  • change the sshd_config in the debian container to allow TTY

  • change my dockerfile many times

  • add ssh options when I connect : ssh -t or ssh -tt


But any of theses ideas seems to help me. I show you my current Dockerfile it can be helpfull.
So can any one tell me if I can change or do something to resolve this problem please ? Thanks

Best Answer:

I solved this problem with adding just one option in my Dockerfile when I create the user :
Now, when I log into the container with SSH, I have a fully complete SHELL.

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com