LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rcp command from one linux to another linux server (https://www.linuxquestions.org/questions/linux-newbie-8/rcp-command-from-one-linux-to-another-linux-server-606072/)

shipon_97 12-11-2007 11:01 AM

rcp command from one linux to another linux server
 
Friends ,

I want to copy a file from one linux server to another linux server using "rcp" command .
But I got the following error :

[root@localhost test]# rcp -rp 192.168.10.2:/test/personal1 192.168.10.1:/test
192.168.10.2: Connection refused

[root@localhost test]# ping 192.168.10.1 //From Linux 1
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=0.324 ms
64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.251 ms

--- 192.168.10.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.251/0.287/0.324/0.040 ms

[root@server ~]# ping 192.168.10.2 //from Linux 2
PING 192.168.10.2 (192.168.10.2) 56(84) bytes of data.
64 bytes from 192.168.10.2: icmp_seq=0 ttl=64 time=0.370 ms
64 bytes from 192.168.10.2: icmp_seq=1 ttl=64 time=0.317 ms
64 bytes from 192.168.10.2: icmp_seq=2 ttl=64 time=0.284 ms

--- 192.168.10.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.284/0.323/0.370/0.041 ms, pipe 2


Here i mention that I got one server to another using ping command . My first server IP is : 192.168.10.1 and another is 192.168.10.1

plz help ... ...

btmiller 12-11-2007 11:04 AM

Rcp is not installed or enabled by default, as it's pretty insecure. Unless you're on a highly trusted local network and need rcp for some particular reason, you should use scp (secure copy) instead. The semantics are the same as rcp.

matthewg42 12-11-2007 11:44 AM

Further to that btmiller said, to be able to scp to a server, that server must be running an ssh server. On Ubuntu & Debian systems, you need to install the openssh-server package. Not sue about the package name on other distros.

It is not typical for sshd to be running in most default configurations.

sshd and related programs provide an effective, secure replacement for the r-tools - rcp, rexec, rsh - and should be used in preference to them in most situations.

shipon_97 12-13-2007 01:50 AM

scp command without password
 
Thx btmiller & matthewg42 for ur answers .
Now I m using 'scp' command for transferring one file from a linux server to another remotely . It works fine like following :


[root@localhost ~]# scp -r /test/drive/ 192.168.10.1:/test/
root@192.168.10.1's password:
shi.sh 100% 43 0.0KB/s 00:00
personal1 100% 0 0.0KB/s 00:00
personal 100% 0 0.0KB/s 00:00
personal2 100% 0 0.0KB/s 00:00

But here I want a situation where 'scp' comand does not prompt for root password . I want passwordless 'scp' command , is it possible ?
Plz help me again ... ...

matthewg42 12-13-2007 05:31 AM

Yes it is possible. You need to set up public key authentication: http://sial.org/howto/openssh/publickey-auth/


All times are GMT -5. The time now is 11:53 AM.