• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6051
  • Last Modified:

How to resolve "rsync error: protocol incompatibility (code 2)"?

Hello Experts,

I'm trying to copy a few files from one server to another (both are remote) from my Windows 7 Prof machine.

'A' to box 'B'. Since I don't have SSH access on box 'A', I'm trying to pull files from box 'A'

I tried this rsync command:
rsync -avrPtz -e 'ssh -p 2202' username@xx.2xx.1xx.xx2:/home/username/somefolder/* /home/username/files/COPIED

Open in new window

but I get this error message instead:
protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(173) [Receiver=3.0.7]

Open in new window

Any ideas would be appreciated. TIA..
2 Solutions
To start: Connect to both machines, and at a command prompt enter:

rsync --version

And assuming it finds an install:

which rsync
which ssh

Note the paths on both the LOCAL and REMOTE compters and plug them into the --rsh and --rsync-path elements of the following rsync call:

rsync -avzP --rsh="/LOCAL_PATH/bin/ssh -l username -p 2202" --rsync-path=/REMOTE_PATH/bin/rsync  xx.2xx.1xx.xx2:/home/username/somefolder/ /home/username/files/COPIED

Open in new window

Then report back.
LinuxGuruLinux Server AdministratorCommented:
This is normally due .bashrc file. You can just move the .bashrc on remote host to some other name and rsync should work fine again.

gam8Author Commented:
Thanks so much for the responses.. My apologies for the delay.

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now