rsh problem connection refused

I'm trying to use rsh command to read a variable on a remote machine. I can rlogin with no problem. If I rsh HOST I also get connection like with rlogin. There is no need for passwords. But when I rsh HOST COMMAND it waits 30 seconds then gives me a connection refused error message. Any ideas?

Thanks.

When you use "rsh hostname" (no command) it talks to the rlogin daemon (port 513). When you use "rsh hostname command", it talks to the rshd daemon (port 514). My guess is that you need to uncomment the "shell" line from /etc/inetd.conf and kill -HUP inetd.

Ahh....that could be a problem. The remote machine i'm trying to access isn't a computer as such but a VME rack. I doubt I'll be able to modify anything on it. I'm trying to read a variable from it and I thought rsh would be the best way to go but I guess another plan will need to be formulated!

when I say another plan needs to be formulated, I'm actually open to suggestions!!

Expect may be your friend. It would allow you to write a script that interacts with a tty, thus allowing the use of rlogin. Although expect was originally part of Tcl, there are is also an expect Perl module and likely other languages too.

A good starting point is Expect - Wikipedia