1829770 Members
2822 Online
109992 Solutions
New Discussion

using rcp commands

 
Juan Pena_1
Occasional Advisor

using rcp commands

Hi all,

I have an SCO/Unix Box and HP-UX box I would like to do remote copies. What are the steps that I should take, so it can work?

Thanks Juan
14 REPLIES 14
Patrick Wallek
Honored Contributor

Re: using rcp commands

You will need to either set up a .rhosts (man rhosts) file, in the users home directory, for each user that will need to use rcp or set up /etc/hosts.equiv (man hosts.equiv) If they are going to be executing rcp on the HP box going to SCO, then .rhosts or /etc/hosts.equiv will have to be defined on the SCO box.

If they are going to be executing rcp, or similar command, on the SCO box, then .rhosts or /etc/hosts.equiv will have to be set up on the HP box.
James R. Ferguson
Acclaimed Contributor

Re: using rcp commands

Hi:

You need to setup an /etc/hosts.equiv or $HOME/.rhosts file. See the man pages for the following:

# man 4 hosts.equiv
# man rcp

...JRF...
Juan Pena_1
Occasional Advisor

Re: using rcp commands

I created the .rhosts and even hosts.equiv
and I get the following error :

remshd: Login incorrect.

Juan Pena_1
Occasional Advisor

Re: using rcp commands

I'm on my SCO/Unix Box and I want to rerieve a file from my HP-UX Box everytime I execute a specific script on my SCO/Unix Box.
Patrick Wallek
Honored Contributor

Re: using rcp commands

Make sure that the hostname is fully qualified in your .rhosts or hosts.equiv.

For example:

host
host.domain.org


I include hostname and the host.domain.org in my files. I had the same problem at one point and adding the fully qualified host.domain.org fixed the problem for me.
Bruce Regittko_1
Esteemed Contributor

Re: using rcp commands

Hi,

If the SCO box is where the rcp command is issued, it is the HP box that will have to have the .rhosts file. Some things to check:

Make sure that the accounts on both boxes have the exact same login name.

Check the /etc/inetd.conf file on the hp box for the following entry: shell stream tcp nowait root /usr/lbin/remshd remshd. Make sure that there is NOT a -l option after remshd and that the line is not commented out.

Verify that the /var/adm/inetd.sec file on the HP box does not disallow the shell service from the SCO box.

Ensure that there is a shell entry in the /etc/services file on the HP box. (I don't know what the port number should be - I'm on a windows machine and can't look it up.)

Read the remshd(1m) man page.

Hope this helps,

--Bruce
www.stratech.com/training
Victor BERRIDGE
Honored Contributor

Re: using rcp commands

Hi,
As Bruce mentionned, the .rhosts should be on the HP box, I just tried to rcp on an SCO a file from an HP...
Regards
Victor
Juan Pena_1
Occasional Advisor

Re: using rcp commands

Everyting works fine, only with "root" how can I make this work with a user named "juan".
Steve Post
Trusted Contributor

Re: using rcp commands

one thing to check is juan's .rhosts file should have permissions of r-- --- --- i.e. chmod 400 ./.rhosts
Juan Pena_1
Occasional Advisor

Re: using rcp commands

juan's .rhosts file permissions of rw- r-- r--
so that not the problem
Patrick Wallek
Honored Contributor

Re: using rcp commands

Is the ~/.rhosts file on the HP box for the user juan in that users home directory? The user juan does exist on the HP box and the SCO box?

The permissions of the ~/.rhosts file really should be READ ONLY for the owner of the file. Having that file so that it is readable by the group and world is a major security no-no.

Bruce Regittko_1
Esteemed Contributor

Re: using rcp commands

Hi again,

If you are sure that juan's .rhosts file is correctly configured and that the permissions are correct, check the remshd entry in /etc/inetd.conf. If remshd is invoked with a -l option, only root will be allowed to use .rhosts - juan will not.

You may want to also see if the following works: replace the contents of juan's .rhosts file with two plus signs - + +. This will set up equivalency for everyone from any host. If you can log in, then it is not an inetd.conf problem. If you can't, check inetd.conf and /var/adm/inetd.sec.

Don't forget to remove the + + from .rhosts since it is a major security hole; ANYONE will be able to login to juan's account without a password.

--Bruce
www.stratech.com/training
David McMullen_1
Occasional Advisor

Re: using rcp commands

you might try:
rcp juan@remotehost:/path /localpath
it's down the hall and to the left...
Steve Post
Trusted Contributor

Re: using rcp commands

Juan, you said:"juan's .rhosts file permissions of rw- r-- r--
so that not the problem "
...Well rw- r-- r-- does not equal r-- --- ---.
I could never get the bugger to work until it was r-- --- ---. That's up to you. I'm probably not reading your response right. But, I would take the whole 10 seconds to change the mode of the file and try it. (I'm scratching my head at this time).