1

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 [email protected]:/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 [email protected]

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?

1
  • 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, 2012 at 18:53

1 Answer 1

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).
2
  • 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, 2012 at 18:07
  • If the root group is the group owner, it should work
    – Khaled
    Jan 22, 2012 at 20:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .