1833758 Members
2169 Online
110063 Solutions
New Discussion

RCP Problem

 
Vasudevan MV
Frequent Advisor

RCP Problem

Hi,

I have written a shell script which does "rcp" 2 files from A box to B box. On A box I have moved /etc/passwd file to someother name( this is a case which has to be tested). After that I ran the script, but this time it failed to do rcp.

Ques: Can I rcp a file from A to B, but A box doesn't have /etc/passwd?

Thanks
Vasu
6 REPLIES 6
Mark van Hassel
Respected Contributor

Re: RCP Problem

No, you need the /etc/passwd file for authentication purposes and things like file ownership.
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
Deepak Extross
Honored Contributor

Re: RCP Problem

What you're observing is expected behaviour. 'rcp' expects the same user-id to exist on both machines. And user-ids are defined by the /etc/passwd file. So rcp will not work if the passwd file is missing.
Magdi KAMAL
Respected Contributor

Re: RCP Problem

Hi,

For sure it will not work.

/etc/passwd file contains Users ID and Groups ID to validate permessions while creating, deleting or updating files. So without it, it's not possible to achieve this step.

So, it's normal behaviour.

Magdi

Vasudevan MV
Frequent Advisor

Re: RCP Problem

Hi,

Thanks for the quick response.
But I thought while doing rcp it searches for the entry (.rhost)& validates the user id only at the destination w/s.

Vasu
Deepak Extross
Honored Contributor
Mark Greene_1
Honored Contributor

Re: RCP Problem

rcp will ultimately call remsh to do the copy. remsh will first look for a hosts.equiv file in the home directory for the login ID. to get the home directory, remsh will read the /etc/password file. so moving the file will indeed result in the behaviour you are seeing.

HTH
mark
the future will be a lot like now, only later