Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

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.

rsync -rdtvu --delete -e ssh -p 22 -i /path/to/sshkey /media/local/media/ user@
Returns this.:
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
ssh -p 22 -i /path/to/sshkey user@

Last edited by NotAComputerGuy; 06-13-2013 at 02:22 PM. Reason: Typo
Old 06-13-2013, 05:06 PM   #2
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:
rsync -rdtvu --delete -e "ssh -p 22 -i /path/to/sshkey" /media/local/media/ user@
To make this easier for the future, you man want to add something to your ~/.ssh/config file. For example:

    User username
    Port 22
Of course, port 22 is the default so you don't need to add that unless you use a non-standard port.


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
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

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


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:39 AM.

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