1834926 Members
2680 Online
110071 Solutions
New Discussion

.rhosts question

 
Donald Rider
Occasional Contributor

.rhosts question

I'm setting up two 11.00 hosts to trust each other via .rhosts as root. Attempts to remsh as root from hosta to hostb fail when I have the fully qualified domain name in each other's /.rhosts file, ie, hosta.mydomain.com. However, when I just put the host name, ie, hosta, in the /.rhosts file, the remsh works fine. Naturally, I would like to have the qualified domain name in the .rhosts files.

The systems resolve host names by its /etc/hosts file, then DNS. Both systems have entries like this:

nnn.nnn.nnn.nnn hosta hosta.mydomain.com
nnn.nnn.nnn.nnn hostb hostb.mydomain.com

The hosts resolve fine both by IP and hostname with nslookup.

What am I doing wrong? Thanks in advance for sparing the lecture on the insecurity of the r-commands.

Don Rider
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor

Re: .rhosts question

Hi Don,

It is all in the lookup. In your /etc/hosts hostb is specified as the primary DNS name and the system will look for it.

On hosta, if you reverse the /etc/hosts entry like below

nnn.nnn.nnn.nnn hostb.mydomain.com hostb

then it will resolve the IP of hostb to fully qualified domain name and you should be able to login.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Donny Jekels
Respected Contributor

Re: .rhosts question

I am not sure I understand you correctly,

This what I understand form your question.

1. when you add the host name in the .rhost file it works, and
2. when you add the FQDN in the .rhost it does'nt

however you have both in the host file.

is this correct?

also check the /etc/nsswitch.conf file to ensure hosts point to files 1st and 2nd to DNS.

also try and remove DNS from this file and try again. I believe (might be wrong) that the remshd daemon will try to reolve by DNS if you have a FQDN in the .rhosts file

peace
Donny
"Vision, is the art of seeing the invisible"
Sunil Sharma_1
Honored Contributor

Re: .rhosts question

Hi Don,

This problem is related to server lookup only.
you have to change the oreder the way you kept the enty in /etc/hosts file.

.rhost file always take hostname not the alias defined. so you can put hosta/hostb as alias nad fully qualified domain name as host name.
your problem will get resolved.

Sunil S
*** Dream as if you'll live forever. Live as if you'll die today ***
Donald Rider
Occasional Contributor

Re: .rhosts question

Sridhar, Sunil- reversing the FQDN and the hostname in /etc/hosts worked. Thanks for your help!

Don