Questions tagged [scp]

SCP (Secure Copy) is a secure protocol based on SSH used for transferring files between computers.

The SCP protocol is basically identical to the BSD rcp protocol. Unlike rcp, data is encrypted during transfer to prevent potential sniffers could extract information from the packets. However, the protocol itself provides no authentication or security, it depends on the protocol below it, SSH to do it.

SCP only implements the file transfer. He does this by connecting to the host using SSH and SCP there running a server (scp). The program of the SCP server is usually the exact same program as the SCP client.

To perform a file upload, the client provides the server files to be uploaded(you can optionally include your basic attributes, such as its access permissions). To download the file, the client sends a request for files or directories to be downloaded. When you are downloading a directory, the server provides the client with its sub-directories and files. So the download is "server-oriented", which poses a security risk when it is connected to a malicious server.

722 questions
209
votes
7 answers

scp between two remote hosts from my (third) pc

I have two remote hosts. host1-> 10.3.0.1 host2-> 10.3.0.2 Both run an ssh server. The ssh server listens on port 22 in host1 and on port 6969 in host2. Now, using my local machine, I need to copy something from host1 to host2 without logging into…
uwais ibrahim
  • 2,191
  • 2
  • 12
  • 4
189
votes
5 answers

What's the difference between SCP and SFTP?

Usually, I use the scp command to transfer files on *nixes. What's the difference between SFTP and SCP? Don't they both work on SSH?
nos
  • 4,258
  • 7
  • 35
  • 36
131
votes
6 answers

scp files via intermediate host

I have access to 3 machines, A, B, and C. The only possible (ssh) connections are: A -> B B <-> C I need to get files from A to C, so I could scp the files from A to B, and then scp them from B to C. However, B doesn't have much disk space, so this…
astrofrog
  • 1,687
  • 3
  • 16
  • 13
131
votes
7 answers

scp to remote server with sudo

I have a file on server A (which is behind a NAT so not directly addressable). The file needs to be copied to server B in a directory restricted to root. I have an account on server B with sudo privileges. What is the syntax for the scp command?
Neil
  • 1,435
  • 2
  • 10
  • 9
102
votes
6 answers

scp with zsh : no matches found

when I try scp over zsh, I get scp hostA:Descargas/debian-6.0.4-* user@192.168.1.154:Escritorio/Software/ zsh: no matches found: hostA:Descargas/debian-6.0.4-* the same command work in bash
juanpablo
  • 6,966
  • 11
  • 52
  • 72
88
votes
3 answers

scp copy has error "ambiguous target"

I try to copy files from a linux (ubuntu) machine to an external hard drive mounted on a mac but got an error message : scp: ambiguous target What I did is, I'm on a mac, ssh to the linux machine where files are. Then use the following command…
bob
  • 983
  • 1
  • 6
  • 6
85
votes
8 answers

Why doesn’t SCP work while SSH does?

If I want to send something via scp to server: scp file server: _____ _____ _____ Then three lines are printed and file is not copied. However I can connect to server via ssh without problem: ssh server How to make scp work?
scdmb
  • 1,081
  • 1
  • 10
  • 9
85
votes
7 answers

Linux: Continuously synchronize files, one way

Scenario: An IDE is set up on a Linux desktop box, editing PHP files locally. Every time I save a file, I want this change to appear on the linux server where Apache is running. The server has ssh (and samba and nfs for that matter). As a reference,…
stolsvik
  • 1,170
  • 1
  • 9
  • 13
82
votes
5 answers

How to copy a file without using scp inside an ssh session?

I have logged on to a system with ssh and there is no scp present on both the systems. How to copy a file without using the scp program.
Talespin_Kit
  • 3,201
  • 6
  • 24
  • 18
66
votes
13 answers

Scp over a proxy with one command from local machine?

I have my local.machine, the proxy.machine and target.machine. local.machine doesn't have direct contact with target.machine, but needs to go through proxy.machine. I want to scp a file from target.machine to local.machine. Is this possible to do…
grm
  • 2,504
  • 3
  • 28
  • 29
65
votes
10 answers

How do I scp the (huge) output of a command directly to a remote machine?

Note that I can't first store the file locally -- it's too big. This (obnoxious) page (scroll all the way to the bottom) seems to give an answer but I'm having trouble disentangling the part that's specific to tape…
dreeves
  • 1,023
  • 1
  • 11
  • 18
65
votes
6 answers

Why is rsync -avz faster than scp -r?

I'm a bit puzzled by this? Why is rsync faster than scp? Doesn't rsync use scp beneath or does it do something more efficient? Is there some way to speed up scp?
grm
  • 2,504
  • 3
  • 28
  • 29
64
votes
2 answers

Using SCP or SFTP with my ssh config file?

Perhaps my google-foo is failing me here... I'd like to connect and upload a mysql dump file via terminal using SFTP or SCP to my remote server using my ssh config file. According to documentation I've found, I should be able to do this: sftp -F…
Danny Englander
  • 745
  • 1
  • 5
  • 6
63
votes
4 answers

scp'ing using key file as a parameter, How can I do that if possible?

scp -i ~/.ssh/id_rsa.pub events*$date*_QA.log $remote_user@$remote_server:$remote_location Is the aforementioned script incorrect? Am I not doing it correctly? I went to the .ssh directory and saw that the remote server is in the known_hosts file.…
user122530
61
votes
4 answers

How can I get the scp command to overwrite the destination folder

I am using the scp command to copy some files to a remote pc, as you do with scp :) I note that the default behaviour of an scp copy for files is to overwrite any existing files. Now I want to copy a folder so I do basically the same thing: scp -r…
code_fodder
  • 1,461
  • 5
  • 20
  • 29
1
2 3
48 49