Trouble backing up over SSH, getting a "connection refused" error
I'm having trouble performing a backup of my entire disk over SSH. I'm getting a "connection refused" error.
I tried running the command:
$ ssh [email protected] "dd if=/dev/sda " | dd of=example.img
but i got the following error:
ssh: connect to host x.x.x.x port 22: Connection refused
There a few things that are sometimes overlooked when one is trying to perform a system image backup in this way. In this case, the SSH service likely wasn’t started after rebooting into Rescue Mode
Next your root password for the rescue system needs to be set, and manually start the SSH service.
service ssh start
Before you move on in this process, make sure that you log in as someone with root/admin priviledges on the machine you intend to copy the image to, and have access to the ssh service on that machine. For Linux and Mac users, you will likely have that by default. For Windows users, you may need to install an SSH client of your choice.
We have a detailed guide on copying a disk image over SSH that details the rest of the process.