3

Hi I have a windows 2003 server that I need to back up onto a linux client so I install cygwin on the Win2k3. On the Win2k3 I have enabled ssh, scp but (because the Win2k3 server uses an customised windows SFTP server listening on port 22) I had to set scp / ssh to run on port 222 on cygwin. It works fine. As long as I use ssh/scp and use the -p/-P switch at command line.

I established a SSH Public/Private Key Pair for my user over ssh/scp it works lovely from linux client to Win2k3 server.

I then I start the rsyncd on Win2k3 and add the user in the /etc/rsyncd.conf, created the /etc/rsyncd.secrets and assigned privilages and it seems fine.

Then when I try to rsync connect /not/ over ssh it works but I want to /only/ connect via ssh and when I do that it fails every time with 0 bytes. I have tried multiple users and rewritten the rsyncd.conf a million times but it constantly fails. I am beginning to think I need to tell rsync client that the ssh port is 222 from the clients perspective. If so how do I do it?

6

Yes, of course you have to:

rsync -e 'ssh -p 222' ...

or:

RSYNC_RSH='ssh -p 222' rsync ...

Alternatively, you can specify in ~/.ssh/config that ssh connections to that host are to be on port 222 by default:

Host that-host
Port 222
1

A very late answer, but one that may help others...

rsync runs in one of two modes.

  1. You can run it across ssh, and the local rsync process will start an rsync process on the remote system to act as its server, with ssh providing the encrypted transport between the two systems. This mode is indicated by a single colon between the remote host and the remote path:

    rsync /path/to/local/ remote:/path/to/remote
    
  2. You can run it as a daemon, and the local rsync process will connect directly to an already-running server rsync process. There is no encryption (or ssh) offered with this scenario. This mode is indicated by a double colon between the remote host and the remote path:

    rsync /path/to/local remote::/path/to/remote
    

You do not need to install an ssh server and an rsync daemon. Either one or the other is quite sufficient.

For a secure LAN, or where the file contents are public, the rsync daemon may be more suitable as it does not require users to be able to log on to the remote system. The ssh approach is better for insecure or untrusted networks (i.e. the Internet) but it does require either very careful set up or the ability for users to be able to log on to the remote system.

In your situation, where you want to be able to connect only over ssh, there is no point configuring or running an rsync daemon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.