Trouble backing up over SSH, getting a "connection refused" error

Linode Staff

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 root@x.x.x.x "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

3 Replies

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

The first step is to reboot Your Linode into Rescue Mode and connect to it using Lish.

Next your root password for the rescue system needs to be set, and manually start the SSH service.

passwd

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.

I'm having this exact same issue. Port 22 or 2223 doesn't matter.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct