Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to sync my remote web folder with my local one $ rsync -navz -e ssh remoteuser@remotehost:www/domain /var/www/html
I am prompted for the password.
remoteuser@remotehost's password:
After I enter the password I get
protocol version mismatch - is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(69)
$ which ssh returns /usr/bin/ssh
ssh is working
My rsync version is 2.6.2-0.
My kernel is 2.6.5-1.358 with Fedora Core 2.
My host's remote kernel is 2.4.29-2-s5
What can I do?
Click here to see the post LQ members have rated as the most helpful post in this thread.
Well, no, there is no output when I do that at shell.
If I do
$ rsync -navz -e ssh remoteuser@remotehost:www/domain 2>/dev/null /var/www/html
I am prompted for the password, but when I enter it I am back to my local shell, as if the connection were instantaneously dropped!
Matir,
Thank you, but I can't connect nevertheless.
I read .bash_profile and even in my extreme ignorance I don't see anything bizarre.
The same for .bashrc
P.S.
Not that it adds to the description of the problem, but I used the last putty version from a Windows box and there was no incompatibility. But I can only afford to do this in Linux.
It should be noted that if you are using passwordless ssh (via certificate), there may be further issues to look at. If the backup account's authorized_keys file (in ~/.ssh) has more than just the ssh-rsa or ssh-dsa line, that is, if it contains a ``command="rsync --server --daemon'' prefix to the ssh-rsa / ssh-dsa line, that could very well be triggering the message, "protocol version mismatch - is your shell clean?"
I've been using bontmia for rsync backups, and it is a great script. However, it seems to expect a clean authorized_keys file, without a ``command=...'', and doesn't say so in the instructions.
Sorry if this was posted twice. When I clicked on "Submit Reply" something went wrong and my browser crashed.
I am having similar problem.
I have 2 system that act as firewalls, one is the backup of another so they are identical.
I use command="rsync --server --daemon ." in the authorized_keys2 file and it works without any problem.
I am trying to do the same with my devlopment and production web server which have different versions of rsync. If I remove
command="...." from the ssh key, the rsync from develpoment to production works. When I add command="rsync --server --daemon ." to the file I get following error:
protocol version mismatch - is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(62)
Do you have to have same version of rsync in order to use server protocol?
Following command creates empty file so I do not think the startup file is problem.
I found this thread here looking for the same problem. In reading this I had an epiphany. I asked myself what has changed since this was working before... what an odd thing to do :P
I use rsync with ssh and authorized key files for auto login to mirror a remote system to the local one.
The only change I made was on my .bashrc on the remote end I added in some commands to show file system usage. do a du -f and a tail of the log on login for conveniences.
My assumption here is that when rsync executes the ssh to connect it received 'junk'. Once I removed the extra output from the .bashrc file on the remote end, it worked just fine.
SO check your remote end for .profile, .bashrc, .bash_profile etc.... any scripts running that add extra output on login.
I'm getting this "protocol version mismatch" error even when I tried to rsync files on the same server.
---------------------
[root@ ~]# rsync -av /home/mohammed/scptest mohammed@localhost:./test/
mohammed@localhost's password:
protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(171) [sender=3.0.6]
[root@ ~]#
---------------------
rsync version 3.0.6 protocol version 30
CentOS release 5 (Final)
I checked .bash* files, I don't see any junk inputs there.
Got an answer <but yet to find a permanent fix for me>
For my customized setup, I had added two commands to /etc/bashrc which apparently confused rysnc. Rsync is working without my additional lines. It looks like any modifications to /etc/bashrc hurts rsync.
The problem is, I can't exclude those two commands from executing when I user logs in. Since they are MUST RUN commands, I am searching for alternatives.
Got through when I added my commands to /etc/profile instead of /etc/bashrc. As far I checked, it's working fine. I'll let you know if I find any issues.
Confirmed: .bashrc output causing remote connect problem
Thanks mohammednv!
Removing output from my remote host's .bashrc file solved my issues connecting to the remote host via rsync, sftp, and scp. (I had a informational echo statement, which is now removed.)
Got through when I added my commands to /etc/profile instead of /etc/bashrc. As far I checked, it's working fine. I'll let you know if I find any issues.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.