Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Cloudera VM how to configure SSH port?

avatar
Explorer

I work with Cloudera VM and I want to assign the port 22 to the port 2222. I go to Cloudera VM -> Settings -> Network -> Advanced -> PortForwarding

 

I add a line

 

Protocol TCP

Host Port  2222

Guest Port 22

 

I execute the command

 

ssh -p 2222 cloudera@localhost

ssh: connect to host localhost port 2222: Connection refused

 

How do I configure the port 2222?

1 REPLY 1

avatar
New Contributor

Just stuck into that myself. What I did:

 

Set up port forwarding in VirtualBox (network settings) from 0.0.0.0:22 guest to 127.0.0.1:2222 host.

Edited /etc/ssh/sshd_config on guest and uncommented Port 22.

Restarted sshd on guest: sudo service sshd restart

Stopped iptables on guest (might be unnecessary):  sudo service iptables stop

Connected from host using line:

ssh -p 2222 -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" cloudera@127.0.0.1

 

SCP command will be:

scp -P 2222 -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" phone_fb_big.csv cloudera@127.0.0.1:~