LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 12: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, 01:53 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
`man rsync` suggests 2 solutions, the most straightforward being to add --port=2222 and not to use :2222.
 
Old 01-29-2007, 01: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, 02:00 PM   #4
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
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, 02: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, 02:22 PM   #6
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

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


Reply



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 41 08-09-2019 03:57 PM
rsync->ssh port lackluster Linux - Software 2 05-27-2007 08: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 06:09 AM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM
rsync and ssh port ohcarol Linux - Software 2 12-22-2004 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:05 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
Open Source Consulting | Domain Registration