rsh problems

Kevin Buettner kev@primenet.com
Mon, 27 Mar 2000 22:00:03 -0700


On Mar 26,  8:45pm, Joel Hanger wrote:

>     I'm having a few problems... I'm setting up just a small beowulf
> cluster, just to test something... but it requires that I have rsh
> working... the problem is this:  I had rsh disabled before because I've
> been using strictly ssh.  Now that I've enabled rsh, it doesn't let
> anyone other than root use it.   It gives me this error:
> 
> [20:44:26][joel@dhanger joel]$ rsh joel
> rcmd: socket: Permission denied
> 
> but if I use root, it works, but of course without allowing me to login,
> but change the user I'm logging in as. Does anyone know how/where
> I could change the permissions or even why it won't let me know but
> would before?  Thanks in advance.

If you look at the glibc source, you'll see the following hunk of
code in rcmd() in rcmd.c.

	s = rresvport(&lport);
		if (s < 0) {
			if (errno == EAGAIN)
				(void)fprintf(stderr,
				    _("rcmd: socket: All ports in use\n"));
			else
				(void)fprintf(stderr, "rcmd: socket: %m\n");
			__sigsetmask(oldmask);
			return -1;
		}

It looks to me like your error message is generated from the second
fprintf() in this hunk of code.  This means that the rresvport() call
failed.

If you read the man page for rresvport(), you'll find the following
description:

     The rresvport() function is used to obtain a socket with a privileged ad-
     dress bound to it.  This socket is suitable for use by rcmd() and several
     other functions.  Privileged Internet ports are those in the range 0 to
     1023.  Only the super-user is allowed to bind an address of this sort to
     a socket.

So, you just need to make sure you somehow gain the appropriate privileges
in order to make the above succeed.

If you were you, I'd check the permissions on your rsh program.  Make
sure that the setuid bit set.

Kevin

-- 
Kevin Buettner
kev@primenet.com, kevinb@redhat.com