LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   rsh localhost - connection refused (https://www.linuxquestions.org/questions/linux-general-1/rsh-localhost-connection-refused-4629/)

mstembri 07-23-2001 01:12 PM

rsh localhost - connection refused
 
RH7.0

The hosts file contains:

Code:

127.0.0.1  server2.intranet.net server2 localhost.localdomain localhost
hosts.equiv contains:
Code:

server2.intranet.net
hosts.allow and hosts.deny are empty (same as old working machine).

rhosts contains:
Code:

server2.intranet.net
server2

All of these files were pulled off another machine, which was working fine (able to accept rsh connections). The new machine is replacing the machine I copied from, so no need to change any of the host names/domains.

Any ideas on why I'm getting 'connection refused'?

DavidPhillips 07-23-2001 08:47 PM

I am not sure of this but, I think that running a remote command on a remote computer has to be run from a remote computer.

The only requirement I know of is that the Host be in .rhosts

Of course the port has to be open. I guess it should be in /etc/services


Can you use ssh instead


sancho5 07-23-2001 10:39 PM

Agreed. RSH is a nonsecure remote login option. If you haven't considered it and can get away with it, use SSH instead. More secure, and more options.
HTH

mstembri 07-24-2001 07:58 AM

I have to have RSH working in order to be able to use rsync.

My hosts and .rhosts files contain the proper name for the remote system - not a nickname. I also checked file permissions - both are owned by root and are read only.

[btw, I can rsh localhost on the main computer without a hitch (prompts me for a username/pw, and I log in).]

Skot 07-24-2001 11:33 AM

Re: rsh
 
If you get the login and password prompts, then something is wrong.

Also, add localhost to your /root/.rhosts and /etc/hosts.equiv files.

/etc/hosts.equiv perms should be "-rw-r--r-- 1 root root" and /root/.rhosts s/b "-rw------- 1 root root" and /home/someuser/.rhosts should be "-rw------- 1 someuser somegroup"

Owned by the users using rsh and 0600 for permissions.

Also /etc/inetd.conf needs to be enabled (remove the "#" from the line) or /etc/xinetd.d/rsh needs to have "disable = no" set

Anything out of place and it just won't work.

mstembri 07-25-2001 09:54 AM

SOLUTION
 
Skot, all that was checked already -- the existing files were pulled off of a known good machine (which was replaced with the one I've been working with).

The solution to this frustrating problem is so simple, I could kick myself for overlooking it.

I checked ntsysv and found the problem - rsh wasn't loading on boot. Remote machines (and localhost) were refused connection because rsh wasn't running. After enabling rsh on boot and restarting, rsh is working great.

Problem solved.

Thanks for the replies fellas.

xramm 10-19-2007 01:11 AM

hi
 
Quote:

Originally Posted by mstembri (Post 18201)
Skot, all that was checked already -- the existing files were pulled off of a known good machine (which was replaced with the one I've been working with).

The solution to this frustrating problem is so simple, I could kick myself for overlooking it.

I checked ntsysv and found the problem - rsh wasn't loading on boot. Remote machines (and localhost) were refused connection because rsh wasn't running. After enabling rsh on boot and restarting, rsh is working great.

Problem solved.

Thanks for the replies fellas.

I have got the very similar problem in Solaris, probably my problem is similar to you have. All configurations are in correct order I still getting connection refused error!

Could you please explain about how to check ntsysv ? and how to or from where enable the rsh running ? a little bit in details ?

jschiwal 10-19-2007 01:20 AM

Please read your rsync manpage because you should be able to use ssh as a transport instead of rsh.
Code:

SETUP
      See the file README for installation instructions.

      Once  installed,  you  can use rsync to any machine that you can access
      via a remote shell (as well as some that you can access using the rsync
      daemon-mode  protocol).  For remote transfers, a modern rsync uses ssh
      for its communications, but it may have been configured to use  a  dif‐
      ferent remote shell by default, such as rsh or remsh.

      You  can also specify any remote shell you like, either by using the -e
      command line option, or by setting the RSYNC_RSH environment  variable.

      Note  that  rsync  must be installed on both the source and destination
      machines.


Since you already checked that the port is open in the firewall, don't be offended if I ask if the rsh daemon is running on the target machine. It's about the only thing not brought up yet.

jschiwal 10-19-2007 03:34 AM

I spent too much time reading through the manpages and missed your last post. I would look into using ssh as the rsync transport.

jschiwal 10-21-2007 06:34 AM

You can use chkconfig to set which runlevels a service runs. To have sshd run in runlevels 3 and 5:

sudo /sbin/chkconfig -s sshd 35

xramm 10-22-2007 07:24 AM

Quote:

Originally Posted by jschiwal (Post 2931473)
You can use chkconfig to set which runlevels a service runs. To have sshd run in runlevels 3 and 5:

sudo /sbin/chkconfig -s sshd 35

can I use chkconfig in Solaris ? As a matter of fact sudo is compatible with Solaris 5.9 or 5.10 ??

jschiwal 10-22-2007 09:30 AM

According to this page, Solaris has the scripts located in a different directory than Red Hat but you can still use chkconfig.

http://www.felipecruz.com/blog_solar...milarities.php

Check your manpages to be certain.

This post lists other options:
http://www.linuxquestions.org/questi...-linux-462910/


All times are GMT -5. The time now is 05:21 AM.