0

I'm not sure what's going on but as of late I can't seem to get any files copied to local from my remote server. I tried rsync from local and get the following error message:

 mut@mylocalcomputer:~$ rsync -chavzP --stats [email protected]:/home/users/mut/thedirectoryIneed /User/mut/
 [email protected]'s  password: 
 protocol version mismatch -- is your shell clean?
 (see the rsync man page for an explanation)
 rsync error: protocol incompatibility (code 2) at /SourceCache/rsync/rsync-42/rsync  /compat.c(61) [receiver=2.6.9] 

So I manned rsync and followed the instructions to diagnose the problem with the following (input into local command line):

ssh [email protected] /bin/true > out.dat

input the password, and got nothing back - it just spit out a new prompt).

(2) So I tried to scp instead, and every time I scp over ssh from local I get the following output displaying filetype, size, permissions and filename, but nothing else:

 C0644 183 fileineedfromremoteserver.cpp

but the file doesn't copy over (or at least I can't find it anywhere on my computer).

Any suggestions as to what the problem might be, or what else I could try?

note: My local is the default terminal CLI on OSX(BSD) and the server is GNU linux. I never had any problems before copying files from the server, and the only thing I can think of that has changed since is that at some point I typed in the command to generate an SSH key from local (in a failed attempt to try and automate my login to the server without having to enter my password every time). I doubt this has anything to do with it though.

1
  • Ok, let's rule that possibility out: 1. rm ~/.ssh/id_* 2. Open the file ~/.ssh/known_hosts and delete the entry associated with mambo.m66.com 3. Regenerate your key pair: ssh-keygen -t rsa (type enter when asked for a passphrase) 4. ssh-copy-id [email protected] (enter your remote pass when prompted) 5. Try again to copy the files, both with rsync and scp
    – asamarin
    Mar 6, 2014 at 1:57

1 Answer 1

0

It's been ages since I've seen this error, but IIRC when I've seen it it was due to having something in the wrong shell rc file that is outputting text when logging in.

The files in question are specific to the shell you are using, but here's how you can fix it for bash.

While logged into the account on the remote system (mambo.m66.com) run the following: . .bashrc (note the first period is not a typo). If you see any output when running that command, you should move the command inside the .bashrc file into .bash_profile.

abydos:~ jonv$ touch sourcefile
abydos:~ jonv$ echo 'echo This should work.' > .bash_profile
abydos:~ jonv$ rsync jonv@localhost:sourcefile destfile
abydos:~ jonv$ echo 'echo This should NOT work.' > .bashrc
abydos:~ jonv$ rsync jonv@localhost:sourcefile destfile
protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at /SourceCache/rsync/rsync-42/rsync/compat.c(61) [receiver=2.6.9]

There are plenty of resources around the net if you want to read further into it. You can search for '.bashrc vs .bash_profile' and get plenty.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .