Unison is a wonderful tool. Cygwin is a wonderful tool. Windows is the dominant desktop platform. Synchronizing two PCs with Unison, where both run Windows is possible, with the aid of Cygwin.
Unison+Windows+Cygwin is NOT obvious to set up. Here's what I did:
- Install Cygwin. Include Open-SSH when you install.
- From a Cygwin shell prompt, enter "ssh-host-config".
- Answer all yes/no questions with yes.
- CYGWIN value is "ntsec tty"
- Privilege separation is NO.
- Do not create an sshd user.
- Note: I run sshd under my personal user-ID instead of sshd, because service accounts don't get to access network shares, and I sometimes want that.
- Ensure that 'kevin' (my Windows user) has Full Control privileges (via Windows Explorer and item properties) to
- Using the Services applet, change the logon user for the "Cygwin sshd" service to kevin.
- Ensure that you can access the Windows server via ordinary ssh login.
- If you use any SUBST drives in Windows, you may need to add to your Cygwin .profile something like "subst K: F:\\k-drive"
- Make sure that unison is in a directory on your PATH on the server. You can eventually get it to work not on your PATH, but there are so many things that can go wrong when you're setting this up that you really want to eliminate this potential source. (Is it /cygdrive/c/bin/unison.exe or is it C:\\bin\\unison.exe or is it C:/bin/unison.exe, etc.)
- The first few lines of your ".prf" file look something like the following. Note that there is a SINGLE slash between winserver and k:. With a Unix host, you'd have TWO slashes. This is because your root is K:/ and it is NOT "/K:/". In Unix, your root is /, you you get "ssh://user@host/" followed by the root "/".
root = K:\ root = ssh://kevin@winserverserver/k:/ servercmd = unison-2.28.9-win-text.exe