Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

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
share|improve this answer
    
yes that works perfectly thank you –  MacLovin May 11 '13 at 18:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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