I want to use an NFS share for backing up. I have created a local user on the client with a specific uid/gid combination that works for writing files to the NFS share. So far so good.

However, I need sudo to read all users' home directories on the local box for backup purposes. But when I do that, the uid/gid is set to 0 and I can't access the NFS share anymore. How do I get around this without access to the server or changing permissions on local files?

  • You can't. You will have to change your backup strategy (eg, to many small backups each running as an individual user). – MadHatter May 7 '15 at 4:20
  • Is there not even a way with some idmapd cleverness? – NFS-woes May 7 '15 at 4:36
  • you can export with no_root_squash and later on change files ownership to desired uid/gid – kofemann May 7 '15 at 6:56
  • That requires access to the server, to change /etc/exports. The question says the OP has no such access. – MadHatter May 7 '15 at 11:56
  • You could use tar to preserve file ownership and other metadata and copy or pipe the tarfile to a process running as an ordinary user to store it on the NFS server. – Dmitri Chubarov May 8 '15 at 10:16

Your Answer

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

Browse other questions tagged or ask your own question.