guys. I wanna set an ssh connection for my docker. Here are my steps.
My information:
Ubuntu:
pull docker
docker pull citybrainchallenge/cbengine:0.1.1go into the container, steps 2-5 are executed in the docker
docker run -it citybrainchallenge/cbengine:0.1.1 bashinstall dependencies
apt-get update apt-get install passwd openssl openssh-server openssh-clientschange password
passwdset the configuration, remove
#vim /etc/ssh/sshd_configPubkeyAuthentication yes PermitRootLogin yes Port 22save the container
- commit to a new container
docker ps # check the container id docker commit container_id new_image_id(I set: citybrainchallenge/cbengine:2.2)run the new container and test it
docker run -it citybrainchallenge/cbengine:2.2 bashIn the container, restart ssh
service restart ssh service --status-all # check ssh is +open a new terminal, Test its connection
docker ps docker port container_id 22However, it didn't work.