rsh in setuid program fails

rsh in setuid program fails

Post by Steve Conro » Fri, 10 Nov 1995 04:00:00


I have looked at all of the FAQ's I can find as well as done
a man on rsh (remote shell) and I'm baffled by this one.

First, I am working on an AIX RS6000 with it's flavor of UNIX
(SYSV).  I have a program called tryme and all it does is a
system call with the command string:

                                rsh remotehost 'ls'

The program (tryme) is owned by a user called "bob".  The file
permissions on tryme look like this:  -rwsr-x---

So I want "tryme" to run SETUID as bob, no matter who runs the
darn program.

I have the .rhosts files at both the remotehost and my local
host set up properly, and "bob" has an account with the same
username at both sites as is apparent when I actually log in
to my computer as "bob" and type bob's password and then run
the tryme program.  It works fine (for bob).  However, when I
am logged in as me and try to run this "tryme" program, I
get an error:

                                rshd: 0826-811 The remote user login is not correct.

This indicates to me that even though my program is running
SETUID as bob, the system call to run rsh is somehow ignoring
the effective user id of bob and it's trying to use me as the
login user at the remote site!  I don't have an account there
hence the error.

The man pages say nothing about rsh taking the real user id
instead of the effective user id.  Does anybody know if this
is true or if I have gone completely mental on this?



1. getpwnam fails in setuid program using NIS+ on HP-UX 11

First of all I hope this is the correct newsgroup to ask this type of
questions, if not let me know.

A call getpwnam("johan") fails if the program is owned by johan and has
the setuid bit set and the program is executed by root. Executed by any
other user it works OK. This happens on HP-UX 11 with NIS+ installed.
The user root is defined in the local /etc/passwd file, johan is defined
in some remote NIS+ table. The errno returned is 'Permission denied'. If
I remove the setuid bit it works correctly under all circumstances.
If I execute it using tusc (the HP variant of truss) it also works
correctly, but I think that's because the setuid is handled in a
peculiar way, I noticed that under different circumstances

Does anybody have any idea what the cause of this problem could be.


2. Color in my terminal?

3. Need help with setuid() problems on 386/ix with setuid root program.

4. olvm & multiple monitors.

5. rsh [server] gawk "gawk-program" fails

6. telinit 5 endless loop??

7. setuid-root and rsh?

8. Pentium boards and memory....myth??

9. rsh and setuid scripts

10. rsh and setuid

11. rsh in a setuid shell script

12. Need help with rsh and setuid between two machines

13. My suid program will not rsh as uid of program