1

I have a backup server in my LAN which mounts the home dir of user@laptop and creates a backup each hour using a python script.

The problem that I'm having is that I get some hundred "permission denied" errors from rsync. Some files won't copy if I start the backup as root, others won't copy if I start it as user.

The first thought that came to my mind was to set group ownership of home from user to root recursively. But I'm not sure if I should really do that..

Does anyone know how to proceed with this?

Some info about the setup:

uid and gid numbers are identical for user and root on both computers.

This is how I import/export home:

Export with: /etc/exports

192.168.178.10(ro,sync,no_subtree_check,root_squash)

Mount with: /etc/auto.user

-fstype=nfs4,ro,tcp 192.168.178.20:/home/username
  • use no_root_squash option – Ijaz Ahmad Khan Jul 26 '16 at 12:09
  • the option ro means "read-only". I would suggest you change your mount option from ro to rw (read/write) when you're performing the backup. – Centimane Jul 26 '16 at 13:16
1

Your export line says

192.168.178.10(ro,sync,no_subtree_check,root_squash)

The root_squash entry means "when remote user root tries to access the file, pretend the user is nobody instead. This means the remote root user has no privileged access at all.

Instead change root_squash to no_root_squash. ie

192.168.178.10(ro,sync,no_subtree_check,no_root_squash)

Now the remote root user will have root level read access to the files.

  • It works perfectly with this fix. Thanks! :) – Rotareti Jul 27 '16 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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