Operating System - Linux
1827891 Members
1719 Online
109969 Solutions
New Discussion

Re: remote copy of file in linux

 
SOLVED
Go to solution
WilliamSmith11
Super Advisor

remote copy of file in linux

Hi I want copy a file from one machine running linux to other one also running linux,

This is my command

rcp jupiter1:/r5/oracle/text1 atlanta:/u01/oracle/text1

send me the followibg error

atlanta:connection refused

in the hosts.allow I have added
jupiter1
atlanta

The same for the other node atlanta.

In the /etc/hosts I also have added the Ip address of both nodes such for jupiter1 and atlanta.

Also in the .rhosts I have added to jupiter and atlanta nodes in both machines.

Whitch could be my error?

Thank you

W,S

rperez
6 REPLIES 6
LiPEnS
Valued Contributor

Re: remote copy of file in linux

Hi
I recommend use scp, in case rcp have to be fulfiled following conditions still:
- started telnet server
- enabled rsh and rlogin (in /etc/xinetd.d/rsh and /etc/xinetd.d/rlogin: disable = no)
- if root user use to rcp this has to be unblocked login by telnet on root (move /etc/securetty to /etc/securetty.org).
All this things lower security of system, no saying about file .rhosts

Regards
Steven E. Protter
Exalted Contributor

Re: remote copy of file in linux

Shalom WS

rcp is not configured by default on Linux. scp is a far more secure and superior item.

If you must use rcp:

vi the r protocol item in /etc/xinetd.d/

Change disable = yes
to disable = no

service xinetd restart

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vipulinux
Respected Contributor

Re: remote copy of file in linux

Hi
In addtion to the above also try specifying a user along with the command.

Cheers
Ivan Ferreira
Honored Contributor

Re: remote copy of file in linux

Instead of rcp, you should use scp, scp is part of SSH and is enabled by default. The scp command is the replacement for rcp. Rcp is deprecated because of security reasons.

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Rick Garland
Honored Contributor
Solution

Re: remote copy of file in linux

You mat not have the R-commands enabled everywhere. As stated use 'scp'. This is installed and enabled by default.

scp user@host:/tmp/

You will probably have to enter the passwd if you have not setup the authorized keys. But this will prompt you at the beginning of the scp process.

Re: remote copy of file in linux

Hi,

Your main mistake is to use hosts.allow and hosts.deny in order to set permissions for rsh/rcp/rlogin.

/etc/hosts.allow and /etc/hosts.deny are used for tcpwrapers only.

The file you are looking for is : /etc/hosts.equiv in which you must add your two hostnames jupiter and atlanta on the two servers. ("jupiter" on atlanta:/etc/hosts.equiv and "atlanta" on jupiter:/etc/hosts.equiv are sufficients but it's really simplest to have the same file on the two servers.)

By having this configuration, any normal unix user are authorized to rsh or rcp from ont to the other.
/etc/hosts.equiv is not working for root connections.
For these, as root you must create a file named $HOME/.rhosts containing
jupiter
atlanta
on the two machines.

By the way, I agree with all others : use SSH instead of rlogin suite (rsh and rcp) 'cause it is much more secure and up to date.

Regards,
Lionel