: >I would like to allow a user without root access to be in charge of doing
: >the tape backups of a small SunOS/Solaris system (30 machines). I currently
: >have a single shell-script that will do the dump. I would like to setuid to
: >root, and allow the user just to load the tape and run the shell-script.
: >My problem is that inside the shell, when 'rsh machinename' is done, it sets
: >the process (on machinename) back to the user's id, rather than root id. Is
: >it possible for a setuid shell-script to use rsh in a way that preserves the
: >root id?
: This is a symptom of rsh asking for the real user id which is
: unchanged by making your script set-uid.
: The supported method of doing what you want is this:
: - put the dump user in group operator (SunOS 4) or
: sys(Solaris 2)
: - make sure the user can write the tape
: - perform dumps under his account
Perhaps I don't understand, but is the problem the user can't access the tape
device, or is it that the backup person cannot access the files to be backed
up? If a common user has his account closed, ie drwx------, I think ONLY
a process with UID 0 will be able to access those files and backup properly,
otherwise, files in that directory will be skipped and won't be backed up.
Setting the group to operator (but still having a uid other than 0) still won't
allow him/her to access files of another user in a closed directory. Is this
Possible solution: Write an program that only allows a person with real UID of
whatever to run it, the program exec's tar with proper arguments, and make sure
the program is SUID so it will run as root. If it only exec's tar, you wont
have to worry about it being used to remove files,*around with stuff,