12-28-2017 02:23 AM
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
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?
04-04-2018 09:50 AM - edited 04-04-2018 10:08 AM
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" firstname.lastname@example.org
SCP command will be:
scp -P 2222 -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" phone_fb_big.csv email@example.com:~