I have an apache server (machine #1) holding a database which I want to rsync distantly (the server is actually owncloud, for those who know). My data is maintained by the server and its rights are rwx------ www-data:www-data or so.
Now I have another distant machine (machine #2) which I would like to use in order to backup the first machine's database. Machine #2 will run rsync over ssh and via a cron job. I am not sure which account to use in order to log to machine #1 via ssh.
- I understand the only 2 accounts which can read/copy the database on machine #1 are www-data and root. As I cannot login as www-data (this is a system account and I do not know the password), does that mean I need to login as root via ssh?
- Is that possible? Is that safe?
- Another way would be to create another account, add it to the www-data group and give the www-data group read rights.
- Unfortunately this is not possible as it is the server (owncloud) and not me which gives the access rights to the database, and the rights given do not allow the www-data group to read the files (at least not on all files): see rwx------
I am not sure how to get the accounts and rights organized so as to be able to rsync distantly. Any idea?
Thanks,
Antoine.