I'm connecting from a Windows 10 box to a Linux system. I'm using msys and git bash in parallel. I want to sync files on the Linux machine using rsync. Currently it is working in msys but not in git bash.
I want it to work in git bash because it's awkward to use both in parallel. I'm choosing git bash over msys because my team needs git anyways. My fellow team members are supposed to use the script I'm writing too and they don't know msys but git bash.
The command I'm using is
rsync -iru -e ssh $(ls -d [^O]*) "advanced@$ip:/home/user/"
In msys this works. In git bash I get the error message.
dup() in/out/err failed
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at /usr/src/rsync/rsync-3.0.8/io.c(760) [sender=3.0.8]
(The local rsync version is 3.0.8 and both msys and git bash use the same binary.)
I know msys and git bash use different ssh binaries. Although a diff shows they are identical, I tried this in git bash
rsync -ru -e '/c/MinGW/msys/1.0/bin/ssh.exe' $(ls -d [^O]*) "advanced@$ip:/home/user/"
which still fails.
It looks like there are some hidden settings being used by ssh, which is plausible insofar msys and git bash use different home directories (a dedicated one and my Windows user directory respectively). However, their respective .ssh directories only contain the usual suspects (id_rsa, id_rsa.pub, known_hosts) and no files that could contain any settings.
Edit:
Below is the contents of /var/log/auth.log. ...211 is the Linux box, ...2 the Windows machine.
Successful (with mingw):
sshd[25494]: Accepted publickey for advanced from 192.168.47.2 port 32589 ssh2: RSA SHA256:ofWD8Ii5DnGUyK2wUDpl71KhQcRajEqBWv6n27YwQ8g
sshd[25494]: pam_keyinit(sshd:session): Unable to look up user "advanced"
sshd[25494]: pam_unix(sshd:session): session opened for user advanced by (uid=0)
sshd[25500]: Received disconnect from 192.168.47.2: 11: disconnected by user
sshd[25494]: pam_unix(sshd:session): session closed for user advanced
sshd[25500]: Disconnected from 192.168.47.2
Unsuccessful (with git bash)
sshd[24626]: Accepted publickey for advanced from 192.168.47.2 port 32488 ssh2: RSA SHA256:ofWD8Ii5DnGUyK2wUDpl71KhQcRajEqBWv6n27YwQ8g
sshd[24626]: pam_keyinit(sshd:session): Unable to look up user "advanced"
sshd[24626]: pam_unix(sshd:session): session opened for user advanced by (uid=0)
sshd[24626]: pam_unix(sshd:session): session closed for user advanced
I don't know what the 'Unable to look up user' is about. When I ssh there as advanced, the same line appears in the log, but I get authenticated as 'advanced' - without root privileges as the '(uid=0)' seems to indicate.