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.

Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

Re: Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

You are trying to do ssh on same server or from outside?

Re: Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

New Contributor

I am having the same issue..has there been any resolution?

Re: Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

New Contributor

can you try disabling your windows firewall?

Re: Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

Super Guru
@Sergei

Can you restart network service of your HDP VM?

service network restart

I have faced similar issue for Sandbox multiple times and I could resolve it by restarting network service.

Re: Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

New Contributor
@Sergei

Hi, was this issue ever resolved? If s could you please share resolution if you don't mind?

I'm having the exact same issue and not sure how to proceed at this point.

Re: Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

New Contributor

@Sergei What is the status of sshd service? Could you try restarting sshd service by command service sshd restart ?

Re: Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

New Contributor

Does anyone get to the solution of the issue till date? plz share..

Re: Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

New Contributor

Hey,

I think the solution should follow this action plan:

  1. install iptables e.g. this way https://stackoverflow.com/questions/24756240/how-can-i-use-iptables-on-centos-7
  2. then you need to open the 2222 port https://stackoverflow.com/questions/19034542/how-to-open-port-in-centos
  3. send the file over ( in my case )
 scp /home/pchpc/vms/file root@192.168.0.7:/root/

This has worked for me.

Hope this helps

Highlighted

Re: Issue using scp on HDP 2.4: "ssh: connect to host localhost port 2222: Connection refused"

New Contributor

Try to connect to vm with vm ip.

ssh -P 2222 someFiles root@10.0.2.15:/root

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