RSH command is giving error (connection refused) | Unix Linux Forums | AIX

  Go Back    


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

RSH command is giving error (connection refused)

AIX


Tags
aix, unix

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-10-2010
anshu ranjan anshu ranjan is offline
Registered User
 
Join Date: Feb 2010
Last Activity: 19 February 2014, 1:21 PM EST
Posts: 35
Thanks: 10
Thanked 1 Time in 1 Post
RSH command is giving error (connection refused)

All,

I am using AIX 5.3.
while running the rsh command I am getting below error message.
------------------
A remote host refused an attempted connect operation.
------------------
.rhost file is updated with correct entry on both the servers. I.e.
Login ID Server name

in /etc/hosts file, entry for server name is there with correct IP address.

Please help me to understand where can be the issue?

Thanks,
Anshu
Sponsored Links
    #2  
Old 04-10-2010
juredd1 juredd1 is offline
Registered User
 
Join Date: Mar 2010
Last Activity: 18 June 2013, 8:29 PM EDT
Posts: 94
Thanks: 4
Thanked 6 Times in 6 Posts
I believe the format of the entries in the .rhosts file should be
Servername LoginID

Make sure that you can resolv the hostname both ways. Meaning from "Host A" you can for example ping "Host B" and it returns what you expect and then ping from "Host B" to "Host A". The best I can remember it must be able to do a reverse lookup. So "Host A" info should be in /etc/hosts on "Host B" and "Host B" should be in the /etc/hosts file on "Host A". If you don't I would recomment having the shortname in the /etc/hosts file as well, for example:
10.1.1.1 testbox.foobar.com testbox

Not sure if you have a firewall between the two hosts, if so you might verify that rsh traffice is allowed between the hosts. Port 514 I think but could be wrong on that one.
Sponsored Links
    #3  
Old 04-12-2010
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
code tag tagger
 
Join Date: Sep 2007
Last Activity: 31 July 2014, 4:18 AM EDT
Location: St. Gallen, Switzerland
Posts: 6,218
Thanks: 120
Thanked 450 Times in 410 Posts
Another good test if the entry in .rhosts might be the problem is, to just login via ssh from the box that tries to get access via rsh and do a

Code:
who am i

and check the hostname given in the last field surrounded by brackets. This is the name that should be placed into the .rhosts. If not necessary you can leave usernames out. Should work only anyway if you keep the UIDs on the systems the same for the user id.
    #4  
Old 04-12-2010
zxmaus's Avatar
zxmaus zxmaus is offline Forum Advisor  
Event Manager
 
Join Date: May 2008
Last Activity: 2 July 2014, 9:40 PM EDT
Location: in a putty session :)
Posts: 806
Thanks: 19
Thanked 69 Times in 61 Posts
Hi,
check if rshd is running - it might be commented in /etcd/inetd.conf (the shell entry) - if so uncomment and start it using
Code:
startsrc -t shell

Kind regards
zxmaus
Sponsored Links
    #5  
Old 04-13-2010
anshu ranjan anshu ranjan is offline
Registered User
 
Join Date: Feb 2010
Last Activity: 19 February 2014, 1:21 PM EST
Posts: 35
Thanks: 10
Thanked 1 Time in 1 Post
Thanks for your kind help ..!!


Yes, .rhosts entry is with server name and then login ID
I am able to do successfull ping from both side.
entry for server name with IP address in there only in respective servers, means in server A /etc/hosts file, only server A entry there.
Suppose I have three server A,B and C..... then I am able to connect to server A and C and vice versa. but from server A or C, if I am trying to connect to server B I am getting "A remote host refused an attempted connect operation". In the same manner if I try to connect from server B to server A/C, I am able to connect but it takes more than expected time.

Any clue ..? please
Sponsored Links
    #6  
Old 04-13-2010
juredd1 juredd1 is offline
Registered User
 
Join Date: Mar 2010
Last Activity: 18 June 2013, 8:29 PM EDT
Posts: 94
Thanks: 4
Thanked 6 Times in 6 Posts
In the past my rsh problems have been related to some sort of resolve problem. Verify what zaxxon suggested. I usually put the shortname and the fully qualified name in the .rhosts file to be safe.

The slowness from server B to server A/C kind of sounds like a those servers are having a hard time resolving Server B.

From server A/C try

Code:
host ServerB

and from server B try the same thing for server A and Server C. Maybe share the results here change the host names for security purposes. I wouldn't mind seeing the .rhost entries from each server as well. Maybe someone will notice something that is not right.
Sponsored Links
    #7  
Old 04-14-2010
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
code tag tagger
 
Join Date: Sep 2007
Last Activity: 31 July 2014, 4:18 AM EDT
Location: St. Gallen, Switzerland
Posts: 6,218
Thanks: 120
Thanked 450 Times in 410 Posts
To check why your name resolving is so slow, you might want to post following outputs all from serverB which is having the problems:

.. and when posting, make sure using [code] and [/code] tags so it is readable for us, ty.


Code:
time nslookup serverA
time nslookup serverC


Code:
cat /etc/resolv.conf


Code:
grep -vE "^#|^$" /etc/netsvc.conf


Code:
grep "serverA|serverC" /etc/hosts


Code:
vmstat -w -t -I 1 10

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
rsh is not working ,error :connection refused aneita Solaris 1 06-08-2008 05:04 PM
Connection refused Dudu1984 IP Networking 1 06-04-2008 06:04 PM
rsh problem connection refused Mace Shell Programming and Scripting 4 06-12-2006 10:28 PM
telnet connection refused printrick SCO 2 01-11-2006 03:38 PM
Connection refused from pop server bluehell IP Networking 2 06-20-2003 10:03 AM



All times are GMT -4. The time now is 11:43 PM.