I have a NFS directory that is used by multiple users, and hosted on a NFS server that I do not control.
I would like to back up the contents of the NFS directory from my client machine. My first attempt was to log in as root on my client machine, and then try to tar up all the files. However, this fails with permission error, as the NFS server maps root to an anonymous user (the root_squash options on the server), so some files are not readable.
So, how can I back up all the files on that NFS directory? In other words, how can I arrange to be able to read all of the files on that shared NFS directory? I don't control the NFS server and cannot configure it to use no_root_squash.
Now, I know that this security restriction can be bypassed. If I wanted to create a new user on my client machine with the right uid, I could su to that user and then read those files. Since I have root on my client machine, I could easily do this -- the NFS server is trusting my client machine. This would be annoying and a kludge, since I'd have to create several fake userids on my client machine and su back and forth between them, but it proves that it's possible in principle for root to read every file on the NFS directory.
My question is: is there a cleaner, easier way to arrange so that I can back up everything in this NFS directory, given that I do have root on my client machine but I don't have any control over the NFS server or its configuration?
Restrictions: I can't switch to a different NFS server. I don't control the configuration of the current NFS server. Any solution that would require all the users to make configuration changes or require extra effort from all the other users is impractical. I'm looking for a solution that doesn't require too much effort on my part (having to write up a bunch of complex scripts to find all the relevant users, create fake uids, su-ing to each one, creating a bunch of tarballs, and somehow merging the tarballs sounds painful).