rsh -Connection refused

Our RedHat 7.2 box will not accept a rsh connection. I can rsh out of it. We need a unix box to rsh in and run a script for faxing. When issuing the command: rsh machine_name it comes back Conection refused. I also have a test Mandrake box that behaves the same way. Any ideas how to trouble-shoot this?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Did you try SSH? Perhaps the sysadmin turned off rsh for security reasons.
timothykingAuthor Commented:
Unfortunatley the unix box does not have ssh installed.
Is the rsh-server package installed and enabled on your 7.2 system?

Have you allowed access to the rsh server via .rhosts and/or hosts.equiv?

Is there a firewall on the 7.2 system that would bolck access to rsh?
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

timothykingAuthor Commented:
I'm sure rsh is installed - not sure how to tell if it is enabled

Which .rhosts file allows access? root?

On the private side of our lan there are no firewall rules that would block access to rsh.

You might have the rsh package installed (client side utilities like rsh) but not have the rsh-server package. You can execute 'rpm -q rsh-server' to see if it is installed. I don't remember for sure on 7.2, but I believe the defaul install of rsh-server leaves it disabled. It is necessary to edit /etc/xinet.d/rsh and enable the service or execute 'chkconfig rsh on'.

How to allow access to the rsh server depends in part on how you intend to use it. If only one user account will initiate all rsh sessions it may suffice to create a .rhosts file in that user's home dir. Otherwise you may wish to list the systems that will initiate rsh sessions in /etc/hosts.equiv. The man page for hosts.equiv, rhosts, rshd and rlogin will provide more information.
timothykingAuthor Commented:
Executing: 'rpm -q rsh-server' returns - rsh-server-0.17-5
In the rsh file it says: disabled - no
.rhosts file exist in all users home directories
Still getting the 'Connection refused'

Is there a firewall running on the 7.2 system and if so does it allow inbound connections on 514/TCP?

You may also need to add the IP's or hostnames on the systems that will initiate rsh sessions to hosts.equiv on you r 7.2 system.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
timothykingAuthor Commented:
Port 514 is open  - and I added the source machine's host and IP to the hosts.equiv file -  still no luck

timothykingAuthor Commented:
Looks like we got it working!
When trying to connect, I was not specifying a command to run. I was just typing:
rsh ipaddress
instead of
rsh ipaddress path_to_command

also the "allowed hosts" must be in the .rhosts file

If you are getting "Connection refused" it sounds like there's a firewall in the way. On both the client and the server  ports 512-1023 must be open for inbound connections the way I read the man page for rshd. I'd suggest that for inital tests you disable any firewall on the server and client. Once you have rsh working you can re-enable the firewall with that port range open. If when you re-enable the firewall rsh stops working a sniffer trace should tell you what the problem is.

FYI: For ordinary users it suffices to have a .rhosts file in the user's home dir owned by the user as set to mode 0600 (-rw---------). For the root user you must include rsh as an "allowed terminal" in /etc/securettys and have a valid /root/.rhosts.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.