I’m create my first docker container from ubuntu:latest image and install openssh-server. Container has exposed port 2201->22.
Next, I set this options:
in container’s /etc/ssh/sshd_config.
After restarting sshd in container I’m trying to ssh into container to localhost:2201 from host and I get this error:
Permission denied, please try again.
Telnet to localhost to 2201 port works fine when container running.
Next, I ssh into private ip:
And it succeeded. Why cannot ssh to exposed port and no problems to private ip?