I’m in a WSL bash shell trying to rsync to a remote cloudcast machine (Debian) over ssh. However, I keep getting protocol mismatch error.
Some research turned up that the most common cause for this is an unclean shell, i.e.: a shell that prints something when logging in.
In the remote machine, I added .hushlogin to the user home, and I also added PS1=”” to .bashrc to get rid of the prompt (per some post somewhere).
Testing for a clean shell shows it really is clean. The following logs in without any messages or even a prompt:
ssh -tt -i ~/id_rsa -F /dev/null -oStrictHostKeyChecking=yes -oUserKnownHostsFile=/mnt/c/Users/anonyuser/AppData/Roaming/GGP/ssh/known_hosts [email protected] -p 44722 --
The following shows log.out is created with 0 bytes:
ssh -tt -i ~/id_rsa -F /dev/null -oStrictHostKeyChecking=yes -oUserKnownHostsFile=/mnt/c/Users/anonyuser/AppData/Roaming/GGP/ssh/known_hosts [email protected] -p 44722 -- false > log.out
And yet this:
rsync -a -v -e "ssh -tt -i ~/id_rsa -F /dev/null -oStrictHostKeyChecking=yes -oUserKnownHostsFile=/mnt/c/Users/anonyuser/AppData/Roaming/GGP/ssh/known_hosts [email protected] -p 44722 --" lol.txt [email protected]:/home/cloudcast/
gives the protocol mismatch version.
Running with -vvvv shows this:
(Client) Protocol versions: remote=1752392034, negotiated=31
I’ve tried adding -q and/or -2 to the ssh command, per some other post somewhere, but no difference.
I checked the rsync versions, and they’re the same in the remote and local machine:
rsync version 3.1.2 protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes, prealloc
The local ssh version is:
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
The remote ssh version is:
OpenSSH_7.4p1 Debian-10+deb9u3, OpenSSL 1.0.2l 25 May 2017
Any ideas on what’s wrong?
2
Answers
Well, based on my comment above I tried the following:
rsync -a -vvvv -e "ssh -tt -i ~/id_rsa -F /dev/null -oStrictHostKeyChecking=yes -oUserKnownHostsFile=/mnt/c/Users/anonyuser/AppData/Roaming/GGP/ssh/known_hosts -p 44722" lol.txt [email protected]:/home/cloudcast/
Notice that there is no IP inside the ssh command and also no --. This got me passed the protocol version mismatch. The rsync still doesn't work, but at least it's a step further!
Edit: The final answer was:
Notice no -tt for the ssh command. It's a bin transfer, d-uh!
I had this issue with a site on Fasthosts, having moved it to newer architecture, to allow me to add an SSL cert to the domain. It turned out that the answer was to be found in the SSH welcome screen, and consisted of simply specifying a different port.