LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 01-29-2007, 01:02 PM   #1
va1damar
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Rep: Reputation: 0
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.
 
Old 01-29-2007, 02:53 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
`man rsync` suggests 2 solutions, the most straightforward being to add --port=2222 and not to use :2222.
 
Old 01-29-2007, 02:56 PM   #3
va1damar
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Original Poster
Rep: Reputation: 0
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?
 
Old 01-29-2007, 03:00 PM   #4
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
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"
.
 
Old 01-29-2007, 03:17 PM   #5
va1damar
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Original Poster
Rep: Reputation: 0
thanks, awesome. works like a dream.
 
Old 01-29-2007, 03:22 PM   #6
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
You're welcome. And thanks for waking me up
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync +ssh on different port? masterross Linux - Software 33 09-22-2014 08:15 PM
rsync->ssh port lackluster Linux - Software 2 05-27-2007 09:42 PM
Howto do Secured ssh from port https or port80(standard) to ssh d listening port 22 ? Xeratul Linux - General 4 11-23-2006 07:09 AM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 01:10 PM
rsync and ssh port ohcarol Linux - Software 2 12-22-2004 11:29 AM


All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration