Questions tagged [scp]

For questions around "Secure Copy Protocol" (SCP). GENERAL SCP SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. Secure Copy Protocol or SCP is a means of securely transferring computer files between a local and a remote host or between two remote hosts over an SSH protocol. This tag is NOT related to "SAP Cloud Platform"!

Secure Copy or SCP is a means of securely transferring computer files between a local and a remote host or between two remote hosts. It is based on the Secure Shell (SSH) protocol.

The term SCP can refer to one of two related things, the SCP protocol or the OpenSSH scp program.

Source: Wikipedia (Secure copy)

1861 questions
52
votes
2 answers

scp fails with "protocol error: filename does not match request"

I have a script that uses SCP to pull a file from a remote Linux host on AWS. After running the same code nightly for about 6 months without issue, it started failing today with protocol error: filename does not match request. I reproduced the…
dcc310
  • 1,038
  • 1
  • 9
  • 13
51
votes
4 answers

scp stalled while copying large files

According to the needs of the experiment, I set the MTU to 8000. After doing this, when I use scp to copy large files, it stalled with 0.00%. I tried scp -l or scp -C and turning tcp_sack on/off, but it still didn't work. And I can't change the MTU…
flyhighzy
  • 610
  • 1
  • 5
  • 8
51
votes
5 answers

Run local python script on remote server

I'm debugging some python script that must run on my virtual machine. And, I prefer to edit the scripts locally(outside of virtual machines). So I find it's tedious to scp modified scripts to virtual machines every time. Can anyone suggests some…
qweruiop
  • 3,156
  • 6
  • 31
  • 55
51
votes
3 answers

How do I download SCP and ssh on Cygwin?

I have downloaded Cygwin on windows 8 and use it for python scripts. How do I get SCP and ssh on Cygwin without having to use WinSCP and Putty?
Asher
  • 811
  • 3
  • 10
  • 19
49
votes
1 answer

File location if target path not specified with scp command

To copy a folder from local computer to server I use scp -r local_folder user@server:path Now I forgot to specify the target path the first time: scp -r local_folder user@server Does anyone now if the folder has been copied and if yes, where in…
user3780714
  • 545
  • 1
  • 4
  • 5
47
votes
5 answers

sending a large file with SCP to a certain server stalls at exactly 2112 kB

There is a certain ubuntu 10.04 server where if I ssh a file onto it from any server that is outside the office where this server is (meaning any of use scp-ing onto this server through LAN from within this server always works for some reason), then…
Attila Szeremi
  • 5,235
  • 5
  • 40
  • 64
47
votes
2 answers

scp from remote host to local host

I am trying to copy a file from a remote machine to the local machine I am using. Whenever I run this command I get prompted to enter a password. I am not sure what to enter for the password as I never configured any password. Anyone have any…
cool_cs
  • 1,661
  • 6
  • 20
  • 26
46
votes
10 answers

How to copy entire folder from Amazon EC2 Linux instance to local Linux machine?

I connected to Amazon's linux instance from ssh using private key. I am trying to copy entire folder from that instance to my local linux machine . Can anyone tell me the correct scp command to do this? Or do I need something more than scp? Both…
Mansoor Elahi
  • 941
  • 1
  • 9
  • 19
46
votes
5 answers

How to copy a directory from local machine to remote machine

I am using ssh to connect to a remote machine. Is there a way i can copy an entire directory from a local machine to the remote machine? I found this link to do it the other way round i.e copying from remote machine to local machine.
nish
  • 6,952
  • 18
  • 74
  • 128
46
votes
2 answers

Does scp create the target folder if it does not exist

I am wondering if scp will create the target folder if it does not exist on the remote server. For example, would this work? scp -r /data/install/somefolder user@ftpserver.com:/data/install/somefolder Here the folder /data/install/somefolder…
Benoit Paquette
  • 491
  • 2
  • 5
  • 4
45
votes
7 answers

Prevent overwriting of files when using Scp

I was copying some files using scp and i don't want to overwrite the already present files. If i was using cp command, i think this can be done using cp -n. Is there a similar option for scp, i went through the documentation of SCP and there seems…
Desert Ice
  • 4,461
  • 5
  • 31
  • 58
44
votes
7 answers

How to copy file from a Vagrant machine to localhost

I want to copy a local file from a Vagrant machine to my localhost, but I am getting an error message: ssh: connect to host 127.0.0.1 port 22: Connection refused. [user@localhost ceil]$ scp -p 2222…
geeks
  • 2,025
  • 6
  • 31
  • 49
40
votes
2 answers

Scp command syntax for copying a folder from local machine to a remote server

I am using putty for copying files from local machine to remote server.My folder is in C:/site can any one give syntax for copying folder from C:/site to remote server using scp
Warrior
  • 5,168
  • 12
  • 60
  • 87
37
votes
3 answers

scp host key verification failed for remote to remote copy

scp foo user@remote:bar works fine scp user@remote:foo bar works fine scp user@remote:foo user@remote:bar fails with error: Host key verification failed. lost connection I am guessing this is because scp disallows remote to remote copy (between two…
necromancer
  • 23,916
  • 22
  • 68
  • 115
33
votes
5 answers

Transferring Files between two EC2 Instances in the same region

I have 2 EC2 instances running Ubuntu 14.04 and I need to figure out how to transfer files from one to another. I read the FAQs from Amazon and it says that I can do this without incurring any additional costs if I use the private IP but I am not…
Kshitiz
  • 2,852
  • 5
  • 32
  • 41