Server Fault is a question and answer site for system and network administrators. 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

Possible Duplicate:
protocol version mismatch — is your shell clean?

I am trying to backup my linux webserver to our local windows sbs 2003 server in the office. I have set up ssh and cwrsync on the windows server and have confirmed that the linux server can reach the windows server via the command:


It asks for a password and connects fine. However when I run this command to start the backup:

*rsync -avz -e ssh home/account/public_html/some/small/directory/*

I get this error after entering the password:

protocol version mismatch -- is your shell clean?

and then it dies.

What does this mean, and how do I fix it?

share|improve this question

migrated from Feb 28 '11 at 1:16

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Sam Nov 7 '11 at 8:39

This question was marked as an exact duplicate of an existing question.

Not a programming question. – unwind Feb 18 '11 at 13:18
up vote 0 down vote accepted

The error protocol version mismatch -- is your shell clean? means that the local rsync gets some invalid data from the remote machine which isn't part of the rsync protocol.

This is normally caused by automatic shell login messages like the message of the day (/etc/motd), therefore the is your shell clean? part.

Log into this machine manually and look if you get any such message. In order to rsync to work you should only get the remote command line prompt. If you get a message try to disable it. Look at your shell config files (e.g. ~/.bashrc, /etc/bash.bashrc for the bash shell) if they contain any command producing this output.

share|improve this answer

One of your login scripts (.bashrc/.cshrc/etc.) may be outputting data to the terminal when it shouldn't be. This is causing ssh to error when it is connecting and getting ready to copy as it starts receiving extra data it doesn't expect. Remove output that is generated in the startup scripts.

You can check if your terminal is interactive and only output text by using the following code in a bashrc. Something equivalent exists for other shells as well:

if shopt -q login_shell; then
    [any code that outputs text here]
share|improve this answer

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