Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Highlighted

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

New Contributor

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.

2 REPLIES 2

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

New Contributor

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.

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

Explorer

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

 

Don't have an account?
Coming from Hortonworks? Activate your account here