1833780 Members
2380 Online
110063 Solutions
New Discussion

rcp don't work

 
SOLVED
Go to solution
alexis_10
Advisor

rcp don't work

i have 2 systems:

system1 -- 11.23
system2 -- 11.11

i have /etc/.rhosts on both:

system1 root
system2 root

and i want rcp file from second system to the first one:

rcp somefile system2:/tmp/

i get:

remshd: Login incorrect.

what's wrong?
10 REPLIES 10
Victor BERRIDGE
Honored Contributor

Re: rcp don't work

Hi,
To start with the .rhosts should be in the home directory...
Next would be to add the remote host in /etc/hosts... (in case it cant resolve the name...)


ALl the best
Victor
Victor BERRIDGE
Honored Contributor
Solution

Re: rcp don't work

Just reread my reply, wasnt clear for me so...
I meant the hoem directory of the user who will be using rcp remsh etc...
If its root and roots home is /home/root it should be there..
If root home is / then it should be in /.
Dont forget the perms something like rw-r------

All the best
Victor
alexis_10
Advisor

Re: rcp don't work

hi, victor!

i trying this under root and i have good /etc/hosts:

192.168.1.1 system1
192.168.1.2 system2

on both systems. and what is more: i can remsh from one system to another with password promt.

system2# remsh system1
-Password:

Mahesh Kumar Malik
Honored Contributor

Re: rcp don't work

Hi Alexis

1 Syntax should be rcp somefile system1:/tmp/ if you are logged in system2 . If looged in server1 then rcp -r server2:/somefile /tmp/somefile

2 Check rlogin from server2 to server1 and vise versa

3 Check ping to server1 by hostname

Regards
Mahesh
Victor BERRIDGE
Honored Contributor

Re: rcp don't work

Hi Alexis,
The idea of .rhosts in the users home directory is to bypass the prompt asking for password...
So what is not good now is your .rhosts that should be in the user's own home directory, but you should prevent others to modify it (Spoofing...)

All the best
Victor
vinod_25
Valued Contributor

Re: rcp don't work

Hi Alexis

The remshd command is the server for the remsh command. The man page for remshd(1M) lists the following option:

-l Disallow authentication based on the user's .rhosts file unless the user is a superuser.

Check to see whether the remsh entry in /etc/inetd.conf contains the -l option (for example):

shell stream tcp nowait root /usr/lbin/remshd remshd -l

If so, then remove the -l entry (for example):

shell stream tcp nowait root /usr/lbin/remshd remshd

and tell inetd to reread the /etc/inetd.conf file:

inetd -c

Now the remshd/rcp command should work.

regards

Vinod K
alexis_10
Advisor

Re: rcp don't work

i've copied /etc/.rhosts to /.rhosts on both systems and rcp now work.

thanks all, especially victor!
Manoj_36
Advisor

Re: rcp don't work

Hi,
You have to give the host and user entery in .rhosts file for rcp to work and .rhosts file should be in home directory of the user on remote host using rcp command locally to avoid the password prompt otherwise it will ask for password. In your case you have to make entry in /<>/.rhosts. Apart from this to resolve the host name you have to make the entry of host name and ip addresses in the /etc/hosts file too. You can check the entery for 'shell' service too in /etc/services file . This service should be there for rcp to work.

Regards.
Fabio Ettore
Honored Contributor

Re: rcp don't work

Hi alexis,

since Victor and other ITRC people helped you to solve the problem then would be nice to assign points to them.
This is a good practice in order to help people that in the future will get the same problem. Also it is another way to thank efforts of ITRC people :-)

Thanks for your collaboration!

All the best on ITRC forum!

Best regards,
Fabio

P.S.: please no points for me here....
WISH? IMPROVEMENT!
Robert Fritz
Regular Advisor

Re: rcp don't work

One additional suggestion: you may want to consider using scp instead of rcp. scp doesn't rely on the IP addresses of the hosts to authenticate, which can easily be faked/spoofed. Its authentication uses keys which stay secret and aren't broadcast over your network. Also, it encrypts your transfer so snoopers can't see that either.

scp is already on your 11.23 systems (part of ssh product), and is a free download for you 11.11 systems:
https://h20293.www2.hp.com/portal/swdepot/try.do?productNumber=T1471AA

-Robert
Those Who Would Sacrifice Liberty for Security Deserve Neither." - Benjamin Franklin