Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question

3 Answers 3

up vote 0 down vote accepted

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.

share|improve this answer
    
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 3 '10 at 11:26

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.

share|improve this answer
    
that's what I thought, but that solution is not compatible with my current configuration. –  Ultraspider Dec 3 '10 at 11:27

I thing you can use /etc/sudoeres

Here have good example

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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