0

Say I have a user with UID 500 on a linux machine for administration purposes. This machine is a backup repository for other *nix machines.

I need the user 500 to access the files in the backups, but the files are owned by other UIDs that don't exist on the local machine (e.g UID 1000).

Is there a way to allow the user with UID 500 to access the files that are owned by UID 1000 ? I searched if there's a way to have a single user with multiple UID but all I found was the opposite (multiple user with the same UID).

I also looked about the group permissions, but the GIDs of the files in the backups already exist on the local machine and I don't know if it's wise to add the user 500 to random groups.

Do you have any idea about that ?

Ultraspider
  • 103
  • 2

3 Answers3

1

If you do not want to change ownership of the files, most options are going to involve root privileges. These include putting a script in sudo, utilizing the SUID bit, or simply taking the actions as root directly.

Warner
  • 23,756
  • 2
  • 59
  • 69
0

Agreed with Warner. If it's necessary to preserve the original UID/GID of the files, then you have to act as root on the backup server. (You could chmod 777 the files, but I really wouldn't recommend that, even if you never allow anyone else to have access to the server.)

Another option is to ignore the UID when backing the files up, so they're all owned by the backup user on the server, then arrange files such that it's easy to see who owns what if you need to restore those files; though that might not be feasible for you. It depends on your setup.

SmallClanger
  • 9,127
  • 1
  • 32
  • 47
  • I think i'll go with that solution, ignoring the UID but creating some kind of lookup table at the time of the backup to restore the original ownership when restoring the file. – Ultraspider Dec 03 '10 at 11:26
0

I thing you can use /etc/sudoeres

Here have good example

http://www.sudo.ws/sudo/sample.sudoers

ntrance
  • 382
  • 2
  • 2