Operating System - HP-UX
1833303 Members
2917 Online
110051 Solutions
New Discussion

Re: How to make 'rcp' command work?

 
Watcharin_1
Occasional Advisor

How to make 'rcp' command work?

Hi,

I've 2 servers HP-UX. I would like its exchange data by using 'rcp' command. What files need to be set such as /.rhosts and what else?

8 REPLIES 8
Stefan Farrelly
Honored Contributor

Re: How to make 'rcp' command work?


.rhosts in the home dir of the login you are using on the remote server is all you should need, although in some cases you may need or use /etc/hosts.equiv instead (see man hosts.equiv)
Im from Palmerston North, New Zealand, but somehow ended up in London...
T G Manikandan
Honored Contributor

Re: How to make 'rcp' command work?

For example if you have two hosts HOSTA and HOSTB.

Make sure you have the ip-address and username in the .rhosts file of the home directory of the user.If you want to rcp HOSTA files from HOSTB as root,

/.rhosts HOSTA

HOSTB-ip root


Then from HOSTB
do a
remsh HOSTA
This should not ask for password.

If it does not ask for a passwd then
#rcp -rp HOSTA: .

-r for copying directories
-p preserve permissions.

Thanks
Robert-Jan Goossens
Honored Contributor

Re: How to make 'rcp' command work?

Hi,

Edit your .rhosts files on both servers like.

.rhosts
unix01 root
unix02 root

check /etc/hosts
145.1.1.1 unix01
145.1.1.2 unix02

rcp -p /.profile unix02:/tmp

done.

RJ
Chia-Wei
Advisor

Re: How to make 'rcp' command work?

Assuming you want to rcp from WorkstationA to WorkstationB, add WorkstationB and the loginB name to the .rhosts file in WorkstationA. For example:

WorkstationB loginB

After that you should be able to use the rcp command:

rcp WorkstationA:/path/file /path/file
Watcharin_1
Occasional Advisor

Re: How to make 'rcp' command work?

Thank you all responses.
It was working by using 'root'.If not, I got the message 'rresvport: bind: Permission denied'.

What need to be changed?


Watcharin


Tom Jackson
Valued Contributor

Re: How to make 'rcp' command work?

Hi:

You need to have the same UID on both hosts. Put a .rhosts file in the home dir of the user ID on the system where you are not executing the commands.

Make sense? hth,

Tom
Robert-Jan Goossens
Honored Contributor

Re: How to make 'rcp' command work?

Hi,

Just change after server name in .rhosts file rhe name of the user.

.rhosts
unix01 user

Regards

RJ.

ps. give points to messages helping you.
John Bolene
Honored Contributor

Re: How to make 'rcp' command work?

Also you probably need the fully qualified domain name in the server name if you are using DNS.

You can find out what is needed by telnetting to the other machine and do a who -a, and look at what is reported as where you are coming from. This is what needs to be in the .rhosts file for the user in his home dir.

PS, / is not always the home dir for root
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com