Answer the question
In order to leave comments, you need to log in
How to ssh into a docker container?
Hi all.
- installed the ssh service in the container
- forwarded the container port 22 to the host
- added permission to connect root to the container in the ssh_config of the container
- I try to connect remotely via ssh, after entering the password it says: permission deny ......
Tell me what could be the problem ? What else do you need to forward to the container besides the port to access it via ssh ?
Thanks
Answer the question
In order to leave comments, you need to log in
This task appeared in connection with the launch of gitlab in a docker container.
There were two solutions:
#PasswordAuthentication yes
uncommented in ssh config?
Why not use docker exec instead of ssh?
https://docs.docker.com/engine/reference/commandli...
If you are trying to connect to a container in Docker via SSH, then you are somehow trying to use Docker in a wrong way.
Why do you need to go there via SSH?
Folder .ssh
with keys from the home directory connected to the container?
docker run \
-v "$HOME/.ssh":/root/.ssh:ro
...
After studying, I realized that the best solution is to use supervisor.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question