0

I tried to transfer a file from an HPC system to a remote CentOS system using the following command line:

scp /ANKAN/data/abc.pdf [email protected]:/data/ANKAN

But I am getting the following error:

ssh: connect to host 192.168.69.231 port 22: Connection refused lost connection

I tried all the commands given in the How to Fix the SSH “Connection Refused” Error webpage at phoenixNAP knowledge base, but nothing worked!

For your information, the port number of the HPC (from where I am transferring the files) is 4422. But when I gave the following command in the remote CentOS system:

sudo grep Port /etc/ssh/sshd_config

the following lines are printed:

Port 22
#GatewayPorts no

So, I tried using the following command lines:

scp -P 4422 /ANKAN/data/abc.pdf [email protected]:/data/ANKAN

and

scp -P 22 /ANKAN/data/abc.pdf [email protected]:/data/ANKAN

But I am getting the same errors.  I can't figure out what is going wrong here.  Can anyone please help me to solve this issue?

1

1 Answer 1

1

Can you successfully perform interactive SSH on the SCP target machine?

I just had a similar situation. The problem was a change in the known key on the source for the target machine.

After flushing it from ~/.ssh/known_hosts the scp is working.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .