I have a situation where in I need to start two docker containers from the same core OS. Both the docker containers must run a ssh server. I expose different ports when I run these container.
For example, Container 1, 9998:22 will expose 9998 and container 2, 9999:22 will expose 9999.
I use the following command to set the password for root in both these container (using dockerfile),
RUN echo 'root:test' |chpasswd.
When I ssh root@IP -p 9998 and use test as password am able to get into that docker container. However, when I ssh root@IP -p 9999 and use the same password I can't. I get permission denied.
Any clues?