Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

First, I know that it was discussed before but I cannot seem to find a reliable solution for this...

I have CentOS 5 with Plesk panel on my remote server where I have sites that need to be backed up. Then I have a local CentOS 6 server with no cpanel (just Webmin installed if it maters).

I am trying to back up my sites from remote server to local server using rsync. It works ok with some new folders from server root but I cannot get into the www directory. I am getting permission errors.

Command is:

rsync -avz --progress adrian@site.com:/var/www/vhosts/site.com/httpdocs/ /_backups

Then it asks for password, I am entering it and after login it says:

rsync: link_stat "/var/www/vhosts/site.com/httpdocs/." failed: Permission denied (13)

Normally when I login by ssh to remote server I cannot login directly with "root" but I login with "adrian" and shows adrian@site in ssh window and then I type "su" and it asks for password again, then I see root@site in ssh window. So I assume is because of this I cannot do rsync directly with root@site.com

Any ideas?

Would it work to create a user adrian_rsync that has its home directory inside the www folder? If so, how can I do that?

Or maybe is there a way to pass the "su" and its password to the rsync command?

share|improve this question
    
Have you checked if adrian has permissions to read /var/www/vhosts/site.com/httpdocs/? Have you tried after an ssh login, if adrian can navigate that directory? –  forcefsck Jan 22 '12 at 18:53
add comment

1 Answer 1

There are several ways to do this:

  1. Use root account in rsync if root login is allowed and root has a password.
  2. Grant your user read permissions on the needed files/folder. This can be done by adding your user to a group which has read access. For example, if nobody group has rx access to this folder, you can add your user to nobody and it should work.
  3. SSH to the server and copy this folder as root and chown to your user. Then, you can rsync remotely the copied version (not convenient).
share|improve this answer
    
Root can access the path properly but I cannot login with it directly in ssh. If I add a new user and make it part of "root" group then it should work, right? –  adrianTNT Jan 22 '12 at 18:07
    
If the root group is the group owner, it should work –  Khaled Jan 22 '12 at 20:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.