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.

746 questions
223
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…
204
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,519
145
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,575
  • 2
  • 10
  • 9
144
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,847
  • 3
  • 17
  • 14
113
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
  • 7,424
96
votes
10 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,211
93
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
  • 1,033
92
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,581
89
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,230
71
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,687
71
votes
2 answers

Using SCP or SFTP with my SSH config file?

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 the documentation I've found, I should be able to do this: sftp -F db.sql.gz webost@staging2.example.com…
69
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? Note! The question is about a fresh copy.
grm
  • 2,602
68
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,063
68
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,602
64
votes
8 answers

Change permissions upon uploading with scp

I am uploading files to my shell account using scp. As I need different permissions on the server than on my computer, I'd like to have a way to easily change the permissions upon upload without needing to ssh to the account and change them…
1
2 3
49 50