Questions tagged [scp]

Secure Copy or SCP is a means of securely transferring computer files between a local and a remote host or between two remote hosts.

SCP uses encryption based on the Secure Shell (SSH) protocol to securely transfer files between hosts. It is available in most Unix distributions via the scp command.

782 questions
185
votes
5 answers

How to copy all files from a directory to a remote directory using scp?

My goal is copy only all files from ~/local_dir to user@host.com /var/www/html/target_dir using scp and do not create local_dir category in local_dir. /var/www/html/target_dir/files.. but not /var/www/html/target_dir/local_dir/files.. when use -r…
173
votes
8 answers

Can scp create a directory if it doesn't exist?

I want to use scp to upload files but sometimes the target directory may not exist. Is it possible to create the folder automatically? If so, how? If not, what alternative way can I try?
AGamePlayer
  • 7,605
166
votes
8 answers

Use scp to transfer a file from local directory X to remote directory Y

I took a look around at other questions here and at various "scp usage" tutorials on Internet, but I can't sort out what's wrong. I'm using Linux Mint and I'm trying to figure out how scp works. I've a file file.ext (on my computer) in directory…
dragonmnl
  • 2,239
150
votes
7 answers

Error using SCP: "not a regular file"

I have been searching for a while and I can't find the definition of a regular file. My path is permanent (I start at /) and I am connecting to scp root@IP: /path/to/picture.jpg Results in an inquiry for a password and then... scp: .: not a regular…
JeffM
  • 1,602
  • 2
  • 10
  • 7
62
votes
5 answers

SCP fails without error

I've been experiencing very strange behavior of SCP for some time: whenever I try to copy a file, the output of SCP contains a bunch of underscores and the file is not copied. $ scp test.txt 192.168.0.2:~ job@192.168.0.2's password: …
mtvec
  • 2,738
52
votes
7 answers

Scp from one server to another server?

I am trying to copy files from one server directly to another, bypassing my local computer. I did scp -r usrname@server1.com:~/data/* usrname@server2.com:~/data/ Password: Host key verification failed. lost connection Is this even possible? How…
51
votes
3 answers

How to copy only new files using "scp" command?

I was copying hundreds of files to another computer using the scp command that I got the stalled error. Now I am going to copy the files again. Is there any way to avoid copying the already copied files?
B Faley
  • 4,343
  • 11
  • 39
  • 48
42
votes
5 answers

How to pull a file from a server using scp?

I am on machine A and want to pull a file from machine B. A$ scp @hostB: . it says that: scp: : No such file or directory But on machine B, this file exists in this path. What is going wrong?
xyz
  • 2,991
32
votes
2 answers

Copying files with certain extensions with scp

I want to copy over .jpg and .png files with scp, but there files with different extensions in the same folder I'm copying from. I am doing the following: scp user@someRemoteHost.com:/folder/*.{jpg,png} . I am asked to enter my password for each…
27
votes
3 answers

Do I need to check for file corruption once scp is done?

I have recursively transferred many files and folders with scp, using the command: scp -rp /source/folder myremoteusername@122.10.12.123:/destination/folder After the transfer is completed, do I need to check whether all files got transferred…
16
votes
2 answers

Running scp when .bashrc of remote machine includes source command

I cannot copy a file over scp when the remote machine .bashrc file includes source command to update paths and some variables. Why does it happen?
14
votes
3 answers

How do I copy a file with scp with special characters?

I am trying to copy a file that has colons and periods, e.g., with: scp "test.json-2014-08-07T11:17:58.662378" remote:tmp/ scp test.json-2014-08-07T11\:17\:58.662378 remote:tmp/ and combinations with file: scp…
8
votes
4 answers

scp force overwrite read only files

I was wanting to use scp to move some files and overwrite any existing instances of these files on the destination server. Some of them may be read only which, of course, courses the scp to fail with "permission denied". I couldn't seem to find a…
Aaron
  • 1,507
7
votes
2 answers

How can I pipe a scp copy from a machine to another?

Let’s say we have three machines: A, B and C. Machine A can't reach machine B from any network, so I can't send files between both. But both A and B can be reached from C (my machine). Today I have to copy a huge file from A to B. Currently I…
Magno C
  • 255
  • 1
  • 2
  • 9
7
votes
1 answer

How to scp through two intermediate servers to a third-hop server

I have seen plenty of examples for scp through an intermediate server to a second-hop server via ProxyCommand operator such that: A:/infile.txt -> B -> C:/outfile.txt Which looks something like the following from A: scp -o 'ProxyCommand ssh…
SYANiDE
  • 507
1
2 3 4 5 6