LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   rsync using alternative ssh port (https://www.linuxquestions.org/questions/linux-networking-3/rsync-using-alternative-ssh-port-523795/)

va1damar 01-29-2007 12:02 PM

rsync using alternative ssh port
 
I'm trying to rsync a server (ssh port 22) to a new mirror (ssh port 2222) but the difference in port numbers is really causing trouble. No matter what I do I get the same error - it's trying to connect on port 22

Code:

> rsync -avz -e ssh user@192.168.1.5:2222/home/me/temp/ /home/me/temp/
or
> rsync -avz -e ssh --port=2222 user@192.168.1.5:/home/me/temp/ /home/me/temp/
or
> rsync -avz -e ssh user@192.168.1.5:/home/me/temp/ --port=2222 /home/me/temp/

ssh: connect to host 192.168.1.5 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(434)

Anyone know what syntax I use to specify the port number? I've been scanning the man page and the web & haven't come up with anything yet.

uselpa 01-29-2007 01:53 PM

`man rsync` suggests 2 solutions, the most straightforward being to add --port=2222 and not to use :2222.

va1damar 01-29-2007 01:56 PM

Quote:

Originally Posted by uselpa
... the most straightforward being to add --port=2222 and not to use :2222.

isn't that what I did in the third command?

uselpa 01-29-2007 02:00 PM

Sorry, long day... well actually it's ssh that tries to connect to port 22 so you need to tell ssh to use another port, not rsync. Try replacing
Code:

-e ssh
by
Code:

-e "ssh -p 2222"
.

va1damar 01-29-2007 02:17 PM

thanks, awesome. works like a dream.

uselpa 01-29-2007 02:22 PM

You're welcome. And thanks for waking me up :)


All times are GMT -5. The time now is 02:29 PM.