gokrazy / rsync

gokrazy rsync
BSD 3-Clause "New" or "Revised" License
510 stars 32 forks source link

Any example for Windows users? #30

Open horacehylee opened 1 year ago

horacehylee commented 1 year ago

Thanks for this awesome work!

May I ask if any Windows example available? As tried with gokr-rsyncd --daemon --gokr.listen=localhost:8730 --gokr.modulemap=pwd=C:\Users\Public and does not work with error of unexpectedly able to write file

stapelberg commented 1 year ago

I had some success with the following rsyncd.toml:

# safe with authorized ssh
dont_namespace = true

[[listener]]
  [listener.authorized_ssh]
    address = ":22873"
    authorized_keys = "authorized_keys.txt"

[[module]]
  name = "repro"
  path = "C:\\Users\\Michael Stapelberg\\rsyncpwd"

…and then starting gokr-rsyncd.exe --daemon --gokr.config rsyncd.toml

From my other machine, I could transfer the files in rsyncpwd using:

% cat >> ~/.ssh/config <<'EOT'
Host beast-windows-rsync
    Hostname beast.lan
    Port 22873
EOT

% rsync -av -e ssh rsync://beast-windows-rsync/repro /tmp/rep
receiving file list ... done
created directory /tmp/rep
./
C:\Users\Michael Stapelberg\rsyncpwd\exfiltrate.png

sent 117 bytes  received 279.055 bytes  558.344,00 bytes/sec
total size is 282.900  speedup is 1,01

% ls -l /tmp/rep
total 276K
-r--r--r-- 1 michael michael 273K 2019-09-20 19:41 'C:\Users\Michael Stapelberg\rsyncpwd\exfiltrate.png'

Note that the filename incorrectly contains the whole path.

I expect that there are a number of smaller issues like that in the code base, as I don’t use Windows.

Improvements welcome.