-   Linux - Newbie (
-   -   Rsync With SSH Syntax? (

NotAComputerGuy 06-13-2013 12:21 PM

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@

quantumsummers 06-13-2013 04:06 PM

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.


NotAComputerGuy 06-13-2013 04:13 PM

Thanks for the reply and the free handy tip! :)

All times are GMT -5. The time now is 01:08 AM.