06-18-2018 01:13 PM
I am trying to access Cloudera running in a docker container ( that I downloaded from Cloudera) running on host A in my network via ( passwordlesss) ssh from remote host B on my network. How is this accomplished? Ideally, I would like to assign the container an alias DNS name and IP address when I start it up so that it will be recognized from host B ( This is my my thinking anyway and am hardly a network expert.)
I have experimented with -ip option -- and others-- when starting up the container but persistently fail. The goal is to be able to ssh into the container with the exact syntax that I would use if I were remotely logging into a "real" Cloudera name node located in a real host in my network. Thank you.
06-19-2018 08:26 AM
I looked closer at the configuration of the container and found that sshd is not available. In other words, the Cloudera container is not configured to work with ssh.
09-02-2018 02:22 PM
Below worked for me:
While startin the docker on host provide this addition parameter in the "docker run" along with other parameters.
So your docker run would look like "docker run --hostname=quickstart.cloudera --privileged=true -t -i -p 52022:22 ..."
Here we are forwarding the SSH port (22) on the container.
Once the container starts, run the below on the Cloudera docker image:
yum -y install openssh-server openssh-clients
chkconfig sshd on
service sshd start
On the host, make sure your port is being forwarded:
# docker port <image-id>. you can obtain the image it by running 'docker images'
docker port 6d80250b3115 22
Now you should be able to connect to the container as below:
ssh -p 52022 email@example.com