LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2010, 09:29 AM   #1
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Rep: Reputation: 30
remote copy file


I would like to use the command rcp to copy file from remote server ( linux ) to local pc , what is the command ?

the remote server name is lnx_srv , the path is /tmp/ora_file1.txt , the linux login id is ora_usr , the .rhosts have released to ora_usr
the localhost pc path is c:\Ora

I read the help page of windows , tried the command rcp lnx_srv.ora_usr:/tmp/ora_file1.txt c:\Ora , but not work , the error is "rsh: can't establish connection" , Can advise what is wrong ? what comamnd should i use ?

Thanks.
 
Old 08-03-2010, 09:49 AM   #2
wahsape
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Rep: Reputation: 0
This is the syntax I found for rcp.

rcp [Host][.User:] [Source] [Host][.User:] [Path\Destination]

Might want to change your c:\Ora to [computer name]\Ora
 
Old 08-03-2010, 09:56 AM   #3
rossdav
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Rep: Reputation: 0
try scp?

rcp is a pretty dated protocol; I would recommend scp, which leverages the SSH daemon that should be running on the system. It sounds like rsh is not running. With a Windows host, you will need PuTTY or Cygwin or some other program to give you SSH capabilities.

change to the directory you want to have the file placed in (Cygwin example)

cd /cygdrive/c/Ora

scp ora_user@lnx_srv:/tmp/ora_file1.txt .

Note the period at the end denoting 'current directory'. Good luck!

Quote:
Originally Posted by elainelaw View Post
I would like to use the command rcp to copy file from remote server ( linux ) to local pc , what is the command ?

the remote server name is lnx_srv , the path is /tmp/ora_file1.txt , the linux login id is ora_usr , the .rhosts have released to ora_usr
the localhost pc path is c:\Ora

I read the help page of windows , tried the command rcp lnx_srv.ora_usr:/tmp/ora_file1.txt c:\Ora , but not work , the error is "rsh: can't establish connection" , Can advise what is wrong ? what comamnd should i use ?

Thanks.
 
Old 08-03-2010, 11:34 AM   #4
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by rossdav View Post
rcp is a pretty dated protocol; I would recommend scp, which leverages the SSH daemon that should be running on the system. It sounds like rsh is not running. With a Windows host, you will need PuTTY or Cygwin or some other program to give you SSH capabilities.

change to the directory you want to have the file placed in (Cygwin example)

cd /cygdrive/c/Ora

scp ora_user@lnx_srv:/tmp/ora_file1.txt .

Note the period at the end denoting 'current directory'. Good luck!
the scp is not available in XP , so I have to use rcp .
 
Old 08-03-2010, 11:36 AM   #5
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by wahsape View Post
This is the syntax I found for rcp.

rcp [Host][.User:] [Source] [Host][.User:] [Path\Destination]

Might want to change your c:\Ora to [computer name]\Ora
Thanks, use computer name ? I want to copy from remote server to local pc .
 
Old 08-05-2010, 06:01 AM   #6
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Original Poster
Rep: Reputation: 30
I also tried the below command , but still not work , can advise what is wrong ?

rcp 192.168.102.1.ora.usr:/tmp/ora_file1.txt c:\Ora



Thanks.
 
Old 08-05-2010, 06:42 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,018

Rep: Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850Reputation: 1850
If you are able to download applications to that particular PC there are many scp clients both GUI and command line. Here is one of each.
http://www.chiark.greenend.org.uk/~s.../download.html
http://winscp.net/eng/download.php

Typically rshd runs from xinetd. The service has to enabled as well as xinetd started. A can't establish connection error could be due to several problems. Is the service running? Does the firewall if enabled allow rsh traffic? Are the hosts.allow, hosts.deny files configured correctly.
 
Old 08-05-2010, 06:46 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,395

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
Taking wahsape's word for the syntax
Code:
rcp 192.168.102.1.ora_usr:/tmp/ora_file1.txt .
if you are running this cmd on the XP system. note you said the username had an underscore, not dot in the middle.
'.' at the end there means put the file 'here' ie current dir.
Looking at your orig error I'd surmise that the rsh/rcp daemon is not running on the lx system, which would be normal. It's a plaintext protocol and as such highly insecure.
If you've got putty on the XP system you can use pscp (Putty implementation of scp; recommended).
If you insist on using rcp, you'll have to install the daemon with your pkg mgr.
Please specify your linux distro and/or add it to your profile so we can help you.
iirc, rcp/rsh usually runs under the xinetd super-daemon.
 
Old 08-05-2010, 10:28 AM   #9
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Original Poster
Rep: Reputation: 30
Thanks reply ,

I want to try rcp first , for my case , I can rcp between linux servers , but can use in between XP and linux , can advise what is wrong ? thx
 
Old 08-05-2010, 10:33 AM   #10
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
As per post #7 - download and install WinSCP - its free and secure. It will achieve what you want in terms of copying data between Win XP and Linux; as well as between Linux servers; via the Win XP machine.

Also you won't need to worry about syntax and so forth as its completely GUI based.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using dd to copy an image file to a remote system kaplan71 Linux - Software 7 04-07-2010 09:50 AM
secure copy a latest data file from the remote host spkandy Linux - Networking 4 08-08-2009 02:46 AM
How to copy a file securly to remote host in JAVA waqasdaar Programming 1 02-03-2009 04:56 AM
scp/ssh tail(multiple file) remote copy tpreitano Linux - General 1 08-22-2005 02:17 PM
scp :copy file from one remote comp to another aniketh Linux - Networking 4 06-16-2004 02:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration