SSH is installed in the Container and I can ssh from the container to the another host without any problem.
The only problem is sshing from another host to the container.
Here is the message I receive
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving “192.xx.x.10” port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.xx.x.10 [192.xx.x.10] port 22.
debug1: connect to address 192.xx.x.10 port 22: Connection refused
ssh: connect to host 192.xx.x.10 port 22: Connection refused
well, there is ssh client (the ssh command) and there is ssh server (sshd). you need the server installed on your container to be able to ssh into it from another system
You would need to install and setup an SSH server in your container. Not sure why you need to ssh to your container.
If it’s a “simple” thing you are trying to do then you can always run a command in a running container using a docker container exec command. And using the Docker Client CLI (or API) you can run commands locally to the container, or remotely (requires setup and authentication).
Example:
I run a container from the httpd:latest Docker Official image and give it a name of apache