1833467 Members
3688 Online
110052 Solutions
New Discussion

Re: rcp question.

 
brian_31
Super Advisor

rcp question.

Hi Team:

We have to rcp some files from the production box(machA) to the development box(machB) on a regular basis. We have set up the development box's .rhosts file as follows..
machA.abc.com root. But the rcp doesn't work. If we add the development box(machB) in the .rhosts of machA(production) then it works fine. Is this not strange?? Does someone have any clues?? We do not want to have any .rhosts entries for development boxes.Please Help.

Thanks
Brian.
8 REPLIES 8
Daimian Woznick
Trusted Contributor

Re: rcp question.

If the .rhosts file is in the root account's home directory, the root entry is not necessary. You may also want to try just the hostname without the "abc.com" in it. You could also try the IP address of the server as well.
A. Clay Stephenson
Acclaimed Contributor

Re: rcp question.

Hi Brian:

Your question is a little ambiguous at this point. Since rcp can 'from' and 'to' from both hosts, it is important to know which machine is issueing the rcp command and thus which host's remshd is actually responding.
If it ain't broke, I can fix that.
brian_31
Super Advisor

Re: rcp question.

Hi Clay:

rcp always runs from the production box(machA) to machB(development). The machB's .rhosts has the required entries(machA.abc.com) but stange enough the rcp from machA only works when there is an entry for machB in machA's .rhosts file, which i feel is not required.

Thanks
Brian.
MANOJ SRIVASTAVA
Honored Contributor

Re: rcp question.

Hi Brian




if you are just wanting to rcp file from A to B then you dont require entries for B in .rhosts of machine A , all you need is that in .rhosts of B an entry for host A , if the A is not defined in /etc/hosts then also you can ahve problems in rcp not working , try using absoulte address ir in .rhosts of B add likt this

10.2.10.35 root 10.2.10.35 is the adress of A


Manoj Srivastava
Jordan Bean
Honored Contributor

Re: rcp question.


Are you invoking rcp this way?

rcp machA:/path/to/file machB:/path/to/file

If so, that would explain why machA wants machB to be in the .rhost file. All you really need to do is this from machA:

rcp /path/to/file machB:/path/to/file

brian_31
Super Advisor

Re: rcp question.

Hi:

We are just using from machA

rcp filename machb:/path/to/filename

Thanks
Brian.
Jordan Bean
Honored Contributor

Re: rcp question.


Wait... I'm wrong. I'm not thinking right today. Need more coffee. 10am is early for me.

rcp machA:path1 machB:path2

may require _machA_ to be in .rhost of machA. I don't deserve any points for my last suggestion.

This is strange indeed.

Frank Slootweg
Honored Contributor

Re: rcp question.

We are talking about ~root/.rhosts (on machB)right? I.e. not some *other* user's .rhosts file.

~root/.rhosts *must* be owned (i.e. UID in ll(1) output) by root.

As others have suggested, leave out the " root" part from ~root/.rhosts, and, better yet, put the IP-address in there, instead of the host[.domain] name and use the IP-adress in the rcp command. This will reveal any name<-->IP lookup problems.

Also, *start* by using remsh(1) instead of rcp(1). remsh and rcp both use .rhosts, but remsh is much simpler. I.e.:

machA # remsh IP_of_machB date

This should *not* ask for a password and should display the date/time.

By the way, what *exactly* does "doesn't work" mean? I *assume* that it means you get "remshd: Login incorrect.", but we need to know for sure.