I am using rsync to get my file updates from my Linux VPS to local Windows PC. For this I use the account I have setup for my websites: let say email@example.com
In order to get to /var/lib/mysql/ directory I need to escalate that user's privileges to SU when using SSH.
When I do rsync for my web content, the user webadmin is fine because it owns the web directory.
Now when I want to get to mysql files, webadmin has not the permissions to get them:
rsync -u -rvz -e 'ssh -p 22' --progress firstname.lastname@example.org:/var/lib/mysql/ /mysql
If I run:
rsync -u -rvz -e 'ssh -p 22' --progress email@example.com:/var/lib/mysql/ /mysql
The server does not allow to login as root.
I created rsa and dsa keys and have put the public ones in the authorized_keys file on the server in order to login w/o password.
For this purpose I have have changed the sshd_config to allow PubkeyAuthentication, PermitRootLogin and RSAAuthentication.
Have set the .ssh permission to 700 and all beneath to 600.
Now, when I run (using cygwin):
rsync -vcr -e "ssh -l root -i /cygdrive/c/cygwin64/home/user123/.ssh" "myserver:/var/lib/mysql/" "/cygdrive/c/backup/mysql"
it still prompts me for password...
What am I doing wrong?