RSYNC

Started by psp83, Jan 05, 2012, 08:25:48

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

psp83

Does anyone know much about RSYNC ?

I'm looking at writing a script that puts selected files/folders to a live site from a UAT server.

So it will be linux to linux via SSH.

jameshurrell

Have a look here: http://www.mikerubel.org/computers/rsync_snapshots/#Rsync. I managed to use it to get something to work to back up from my Linux VPS to my local QNAP NAS... took a bit of effort but with cron it works well.

For local to remote, something like:

rsync -a -e ssh source/ username@remotemachine.com:/path/to/destination/

psp83

I use the following

rsync -avzx --progress /home/username/public_html/ user@example.com:/home/username/public_html/

You don't need to use -e ssh as rsync works over ssh by default.

The issue I am getting now is that the server is asking for the passphrase everytime even though keys are generated and on the correct side.

On the UAT server the following was ran :


ssh-keygen
ssh-copy-id user@example.com


Everything has been added to ssh-agent as well. But when I run the rsync command I get asked for the passphrase.

Steve

Paul have a read through this.- http://troy.jdmz.net/rsync/index.html it's fairly logical and comprehensive I hope it's applicable - note the file permissions I was wondering if that was relevant if your stored keys weren't accessible.
Steve
------------
This post reflects my own views, opinions and experience, not those of IDNet.

psp83

Hi Steve,

Thanks for the link. I just checked and the permissions of the keys are correct and the .sh script I'm running is correct at 700.

I've also looked at the authorized_keys file and the correct information is there.

Its a weird issue and I guess the hosts will have to look into it as its acting like the agent id is changing every time the script is ran so it's re asking for the passphrase.

nowster

Quote from: psp83 on Jan 10, 2012, 22:13:23
Everything has been added to ssh-agent as well. But when I run the rsync command I get asked for the passphrase.
Did you run ssh-add?

psp83


nowster

Try ssh -v user@hostname and see what's failing.

If everything's working, you should see within the debug output something like:

debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering DSA public key: /home/user/.ssh/id_dsa
debug1: Server accepts key: pkalg ssh-dss blen 434
debug1: Enabling compression at level 6.
debug1: Authentication succeeded (publickey).