LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2013, 01:21 PM   #1
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 348

Rep: Reputation: 13
Rsync With SSH Syntax?


I'm looking to try and use Rsync to push data from my local computer to a remote computer through SSH, using a specific key and a specific port and I'm struggling.

Code:
rsync -rdtvu --delete -e ssh -p 22 -i /path/to/sshkey /media/local/media/ user@192.168.0.1:/media/remote/dir/
Returns this.:
Code:
Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(605) [sender=3.0.9]
I can ssh into the remote box fine using
Code:
ssh -p 22 -i /path/to/sshkey user@192.168.0.1

Last edited by NotAComputerGuy; 06-13-2013 at 02:22 PM. Reason: Typo
 
Old 06-13-2013, 05:06 PM   #2
quantumsummers
LQ Newbie
 
Registered: Oct 2006
Posts: 6

Rep: Reputation: Disabled
You need to place the args to the -e switch in quotes. So, you should have:
Code:
rsync -rdtvu --delete -e "ssh -p 22 -i /path/to/sshkey" /media/local/media/ user@192.168.0.1:/media/remote/dir/
To make this easier for the future, you man want to add something to your ~/.ssh/config file. For example:

Code:
Host 192.168.0.1
    User username
    Port 22
    IdentityFile=/path/to/sshkey
Of course, port 22 is the default so you don't need to add that unless you use a non-standard port.

Cheers!

Last edited by quantumsummers; 06-13-2013 at 05:08 PM.
 
1 members found this post helpful.
Old 06-13-2013, 05:13 PM   #3
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 348

Original Poster
Rep: Reputation: 13
Thanks for the reply and the free handy tip!
 
  


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 syntax for local copy hoover93 Linux - Software 3 12-21-2012 03:39 AM
[SOLVED] rsync fails in cron - ssh key prob for rsync? jonathansfl Linux - Server 6 12-09-2010 10:48 AM
Rsync syntax question alexpacio Linux - Software 5 07-23-2007 07:27 PM
help with rsync exclude syntax please JacekZ Linux - General 2 07-08-2007 02:23 PM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 01:10 PM


All times are GMT -5. The time now is 04:16 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration