Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I’m trying to copy a disk image over ssh to my local machine using this tutorial on linodes website.

I know this could be posted on their support forum, but im convinced its in the general realm of *unix knowledge.

I’ve followed all the steps and I can get int Finnix (custom editor), checked the disk images and now I want to download it via SSH to my local machine. I keep getting:

I can already ssh into the remote server, its when im in Finnix.

root@hvc0~# ....

ssh root@xxxxxxxxx port 22: connection refused

after typing

ssh root@xxx.xx.xx.xx "dd if=/dev/xvdb " | dd of=/home/linode.img

So I’ve re-written the firewall rules, checked for memory leaks, reset root password, logged in via the ajax console on their site, pings, disk space and still no luck.

Any suggestions on why this is?

share|improve this question
did you install ssh server on your machine? Did you start it? – pqnet Aug 12 '14 at 12:20
I can already ssh into the remote server. I've enabled remote login on my machine but isn't that only if I want to access another mac / make mine accessible to another mac? – lxm7 Aug 12 '14 at 13:26
@pqnet : He is able to login to the remote system through ssh.That means ssh server is already there in his machine. – Thushi Aug 12 '14 at 14:04
@Learn port 22: connection refused is pretty clear. There is no ssh daemon (or is blocked by a firewall) on machine root@xxx.xx.xx.xx. Read my answer below for my best guess. Also, the line "I can already ssh into the remote server, its when im in Finnix." was added after my comment – pqnet Aug 12 '14 at 14:13
tdpdump or tshark is your friend. Run it at both ends to confirm first that the packets are leaving and then second to confirm that they arrive. If the packets arrive, is there a response and does the response arrive back where the whole thing started. Checking this will give you a lot of clues. – ericx Aug 12 '14 at 15:04

the command

ssh root@xxx.xx.xx.xx "dd if=/dev/xvdb " | dd of=/home/linode.img

needs to be typed on the machine where you want to save the backup (the one having /home/linode.img), and xxx.xx.xx.xx needs to be the machine you want to backup. After reading better I feel like the problem is that you are doing the opposite.

scp is not the right command in this case, since he wants to copy directly from the server hard disk device (in opposition to copy only one file). This is why the guide suggested that command instead.

share|improve this answer
Might be improved to include any guesses on what's wrong. – Pavel Šimerda Dec 27 '14 at 20:17

If you want to copy a file, use scp instead. The syntax is pretty simple:

scp remote-user@ip-remote-server:path/file.img .

This command needs to be executed from your local machine, replacing all the variables above. You can use variations of the syntax and find many examples in scp manpage.

share|improve this answer
You're right, but "connection refused" precludes ssh, scp, and sftp. – ericx Aug 12 '14 at 15:05
Do you have openssh-server package in both machines? – Willian Paixao Aug 12 '14 at 15:07
Doesn't solve the issue and there may be reasons to run dd rather than (s)cp. – Pavel Šimerda Dec 27 '14 at 20:16

Using ssh you can login to the remote system but you can't copy any files from the remote system.To copy file from the remote system you can use scp command from your local system as below .

scp remote-user@remote-system-ip:/some/remote/dir/file /local/system/dir

and if you want to copy directory from the remote system then you use -r option to scp .

share|improve this answer
Thanks Learn. The thing is its via linode website so I'm guessing it uses its own syntax as per above. I tried your option and could resolve IP (which it can normally) – lxm7 Aug 12 '14 at 14:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.