[Solved] SSH connection refused

[Solved] SSH connection refused

Postby petedan10 » Jan 25th, '17, 18:47

I run a VM under Mageia 5.1 for experimentation and try to ssh into the VM and use scp to transfer files between the VM and the host.

The VM runs Mageia, which I have installed in text mode without any graphical interface. I included OpenSSL and omitted firewalls.

Now file transfer doesn't work. Running scp (on the host) gives me constantly a file not found error. SSH into the VM IP works, but when I try to use scp (under ssh) I get an ssh error about the host IP refusing connections.

I have checked the firewall on the host and have enabled ping and ssh for all interfaces. Pinging works fine in both directions (pinging the host from the VM and the VM from the host).

So I can ssh into VM, but scp under ssh or on its own fails with a connection refused or a file not found message respectively.

Is there something I miss?
Last edited by petedan10 on Feb 1st, '17, 11:16, edited 2 times in total.
petedan10
 
Posts: 69
Joined: Jun 27th, '15, 10:23

Re: [Workaround] SSH connection refused

Postby petedan10 » Jan 26th, '17, 11:37

I found a workaround using Filezilla, which works pretty good.

But still, I can't figure out why the command line approach doesn't work.
petedan10
 
Posts: 69
Joined: Jun 27th, '15, 10:23

Re: [Workaround] SSH connection refused

Postby doktor5000 » Jan 27th, '17, 00:34

You could compare the behaviour from
Code: Select all
ssh user@host "ls -al /path/to/file"
scp user@host:/path/to/file .
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17630
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [Workaround] SSH connection refused

Postby petedan10 » Feb 1st, '17, 11:15

doktor5000 wrote:You could compare the behaviour from
Code: Select all
ssh user@host "ls -al /path/to/file"
scp user@host:/path/to/file .

As both lines worked fine, I found out what the problem was.

The references I was following suggested something like
Code: Select all
scp user@192.56.0.1/path/to/file remote@192.56.0.2:/path/to/file

which prompted the errors I mentioned.
The right syntax was
Code: Select all
scp /localpath/to/file remote@192.56.0.2:/path/to/file
petedan10
 
Posts: 69
Joined: Jun 27th, '15, 10:23

Re: [Workaround] SSH connection refused

Postby doktor5000 » Feb 1st, '17, 18:48

petedan10 wrote:The references I was following suggested something like
Code: Select all
scp user@192.56.0.1/path/to/file remote@192.56.0.2:/path/to/file

which prompted the errors I mentioned.


If you would have mentioned that in the beginning in your original post this could have been solved much more promptly.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17630
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron