Netpavee
Posts: 2
Joined: Thu May 25, 2017 2:59 am

About SCP

Thu May 25, 2017 4:03 am

I suspect for scp (secure copy) . I use scp command for copy file from redhat to pi
is complete but I want to copy back (from pi to redhat) .It "Connection timed out lost connection" I want to know for pi >>redhat it possible or not? I want to solution about problem .

Environment:
- Redhat ver. 5 and 6
- Raspberry PI 2 Model B
- Config ip : OK!
- Stoped firewall
- Port22 , ssh : enabled
- Can ping both

I hope you help.Thank you very much.

User avatar
lmarmisa
Posts: 1222
Joined: Thu Feb 14, 2013 2:22 am
Location: Jávea, Spain

Re: About SCP

Thu May 25, 2017 10:16 pm

I believe that scp should work fine on your RPi. I use very often scp transfers from my RPis with no problem.

Martin Frezman
Posts: 1020
Joined: Mon Oct 31, 2016 10:05 am

Re: About SCP

Fri May 26, 2017 12:03 am

Either sshd isn't running on the RedHat side or there is a firewall running on RedHat that is interfering. You'll need to figure out which and fix.
If this post appears in the wrong forums category, my apologies.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: About SCP

Fri May 26, 2017 1:38 am

Netpavee wrote:Environment:
- Redhat ver. 5 and 6
- Raspberry PI 2 Model B
- Config ip : OK!
- Stoped firewall
- Port22 , ssh : enabled
- Can ping both
Can you ssh from the redhat machine to itself?

Netpavee
Posts: 2
Joined: Thu May 25, 2017 2:59 am

Re: About SCP

Fri May 26, 2017 9:00 am

thanks for answer everyone but I forget tell about scp .I testing scp between redhat5 and redhat6 is complete. and this picture I opened ssh server redhat and pi too. :cry:
Attachments
Capture.PNG
Capture.PNG (59.35 KiB) Viewed 1409 times

User avatar
RaTTuS
Posts: 10313
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: About SCP

Fri May 26, 2017 9:37 am

if you can ssh from machine1 to machine2
then you can scp from machine1 to machine2 and visa vesra
if you get errors part way then you have other issues..
see also
rsync from machine1 to machine2
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: About SCP

Fri May 26, 2017 11:11 am

Netpavee wrote:I suspect for scp (secure copy) . I use scp command for copy file from redhat to pi
is complete but I want to copy back (from pi to redhat) .It "Connection timed out lost connection" I want to know for pi >>redhat it possible or not? I want to solution about problem .

Environment:
- Redhat ver. 5 and 6
- Raspberry PI 2 Model B
- Config ip : OK!
- Stoped firewall
- Port22 , ssh : enabled
- Can ping both

I hope you help.Thank you very much.
In it's most simple form scp just takes a source and destination file path. These can be local files or a user@host:/file path. So all of the following are possible
  • scp file1 file2 (same as 'cp file1 file2' - i.e. works on local files only)
  • scp file pi@raspberrypi: (copies the local 'file' to a remote pi)
  • scp pi@raspberrypi:file . (copies the remote 'file' on a remote pi to the local directory)
  • scp pi@rasp1:file pi@rasp2: (Copies 'file' from rasp1 to rasp2 via the current machine - useful where the source and destination are on networks that can't talk to each other)

User avatar
cresfang
Posts: 37
Joined: Fri Apr 29, 2016 3:03 am
Location: Garden of Time
Contact: Website

Re: About SCP

Mon May 29, 2017 3:06 am

SCP - Secure Contain Protect....
Raspberry Pi 3

Ernst
Posts: 1140
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: About SCP

Mon May 29, 2017 10:03 am

Netpavee wrote:I suspect for scp (secure copy) . I use scp command for copy file from redhat to pi
is complete but I want to copy back (from pi to redhat) .It "Connection timed out lost connection" I want to know for pi >>redhat it possible or not? I want to solution about problem .

Environment:
- Redhat ver. 5 and 6
- Raspberry PI 2 Model B
- Config ip : OK!
- Stoped firewall
- Port22 , ssh : enabled
- Can ping both

I hope you help.Thank you very much.
Do you know that the word "pi" can have different meanings and usage ?
Sometimes it is used as an abbreviation for the term "Raspberry Pi" (like you did), sometimes it is the default user name 'pi' that is used to login.
When using scp the username "pi" can be the cause of confusion, if you login the the raspberry with the username "pi" then this username will be used by scp if you do not specify a username on the command line. What this means is that scp from raspberry to redhat may use the username "pi" to login into redhat if you do not specify a username.

What I suggest is that you take a piece of paper and write down the following:
- username on the raspberry, password on raspberry
- username on redhat, password on redhat.

As a test do the following:
- On the raspberry enter "ssh <redhat username>@<redhat ip address>" and make sure that you can login to redhat
- On redhat enter "ssh <raspberry username>@<raspberry ip address>" and make sure that you can login to raspberry

Once you have this working you can test scp to copy files to the remote system:
- On the raspberry enter "scp <filename> <redhat username>@<redhat ip address>:<filename>"
- On redhat enter: "scp <filename> <raspberry username>@<raspberry ip address>:<filename>"

to copy from the remote system to the local system:
- On the raspberry enter "scp <redhat username>@<redhat ip address>:<filename> <filename>"
- On redhat enter: "scp <raspberry username>@<raspberry ip address>:<filename> <filename>"

please note that you will have to enter the password for the remote system.
The road to insanity is paved with static ip addresses

Return to “Advanced users”