Reply
Highlighted
New Contributor
Posts: 7
Registered: ‎06-14-2018

How configure cloudera running in docker container so can ssh into it from remote host?

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.

New Contributor
Posts: 7
Registered: ‎06-14-2018

Re: How configure cloudera running in docker container so can ssh into it from remote host?

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.

Explorer
Posts: 7
Registered: ‎03-23-2015

Re: How configure cloudera running in docker container so can ssh into it from remote host?

Below worked for me:


While startin the docker on host provide this addition parameter in the "docker run" along
with other parameters.

"-p 52022:22" 

 

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

0.0.0.0:52022

 

 

Now you should be able to connect to the container as below:

 

ssh -p 52022 cloudera@0.0.0.0

 

Announcements