LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-23-2001, 01:12 PM   #1
mstembri
LQ Newbie
 
Registered: May 2001
Posts: 14

Rep: Reputation: 0
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'?
 
Old 07-23-2001, 08:47 PM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
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


Last edited by DavidPhillips; 07-23-2001 at 08:53 PM.
 
Old 07-23-2001, 10:39 PM   #3
sancho5
Member
 
Registered: Jul 2001
Location: Utah
Distribution: RedHat v7.3, OpenBSD 3.3, FreeBSD 5.0
Posts: 327

Rep: Reputation: 30
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
 
Old 07-24-2001, 07:58 AM   #4
mstembri
LQ Newbie
 
Registered: May 2001
Posts: 14

Original Poster
Rep: Reputation: 0
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).]
 
Old 07-24-2001, 11:33 AM   #5
Skot
LQ Newbie
 
Registered: Jul 2001
Distribution: LMdk 7.x mostly
Posts: 19

Rep: Reputation: 0
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.
 
Old 07-25-2001, 09:54 AM   #6
mstembri
LQ Newbie
 
Registered: May 2001
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
Old 10-19-2007, 01:11 AM   #7
xramm
LQ Newbie
 
Registered: Sep 2007
Posts: 17

Rep: Reputation: 0
Question hi

Quote:
Originally Posted by mstembri View Post
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 ?
 
Old 10-19-2007, 01:20 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 10-19-2007, 03:34 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I spent too much time reading through the manpages and missed your last post. I would look into using ssh as the rsync transport.
 
Old 10-21-2007, 06:34 AM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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
 
Old 10-22-2007, 07:24 AM   #11
xramm
LQ Newbie
 
Registered: Sep 2007
Posts: 17

Rep: Reputation: 0
Question

Quote:
Originally Posted by jschiwal View Post
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 ??
 
Old 10-22-2007, 09:30 AM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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/

Last edited by jschiwal; 10-22-2007 at 09:32 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection refused rsh onaeem Linux - Networking 7 02-25-2011 12:44 AM
Connection to localhost refused?!? a_priebe47 Slackware 4 09-01-2004 09:05 PM
rsh : connection refused problem on RH9 haoscar Linux - Software 3 07-19-2004 11:12 PM
connection to localhost refused digitalgravy Linux - Networking 5 05-03-2004 04:27 PM
rsh localhost : connection refused StressedLemming Linux - Networking 1 11-09-2003 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration