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

learn more… | top users | synonyms

34
votes
14answers
51k views

Map remote drive in Windows over SSH

Does anyone know of a good (hopefully free) tool that can be used to map a Linux server accessible over SSH/SCP as a Windows network drive? EDIT: SFTP not supported EDIT2: Windows File Sharing/Samba ...
29
votes
6answers
24k views

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 ...
24
votes
15answers
31k views

Best way to copy millions of files between 2 servers

I have roughly around 5 million small (5-30k) files in a single directory that I would like to copy to another machine on the same gigabit network. I tried using rsync, but it would slow down to a ...
20
votes
7answers
13k views

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 ...
19
votes
6answers
18k views

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?
18
votes
2answers
52k views

How do I SCP from remote machine to local machine when I am outside of my home network?

While I understand how to scp files to and from my server from within my home network, how can I scp a file from my server to my local machine when I am on the outside, say at Starbucks? While I am ...
18
votes
3answers
20k views

scp -r … but leave out (exclude) a specified subdirectory

Here's the directory structure: /a/ /a/b/ /a/c/ I want to copy everything, EXCEPT for the /a/c/ subdirectory. scp -rp myserver:/a . # this will copy everything Q: How would I specify a ...
16
votes
3answers
6k views

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 ...
14
votes
7answers
6k views

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 ...
14
votes
7answers
13k views

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 ...
13
votes
10answers
45k views

WinSCP client for Ubuntu

Are there any GUI clients for Ubuntu which can remotely connect to another Linux box over SCP? I heard about the fish:// protocol and Konqueror (which is for Kubuntu using KDE), but I am looking for ...
12
votes
4answers
3k views

Resume recursive scp transfer (with rsync?)

I was transferring several thousand files each ~1MB via scp and my connection was broken after the first 2k files or so. I wanted to know if there was a way to resume the recursive transfer w/o ...
11
votes
1answer
5k views

Reverse SCP over SSH connection

I pretty often need some file from some server when I'm on my laptop. But if I don't know where that file is, I have to ssh into the server, look around, exit, and then scp server:file .. If I'm ...
11
votes
5answers
5k views

Is it possible to SCP from a remote to local whilst logged into the remote and without knowing the local's IP address?

I regularly find myself wanting to copy a file from remote terminal session to my local machine. Usually I log out of the remote session and call an scp transfer from local to copy the file from ...
10
votes
3answers
4k views

SCP between two networks

I need to transfer a file between two computers that are not connected to the same network. I got a third computer that can see both networks through a VPN. From the third computer, I can do: scp ...
9
votes
3answers
9k views

Allow incoming SCP connections on Mac

How can I allow incoming scp connections on my mac (Mac OS X 10.6.4) from other machines on the same network? Every time I'm trying to scp something on the machine I get a Connection refused error. ...
9
votes
1answer
6k views

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 ...
8
votes
4answers
6k views

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 ...
8
votes
4answers
10k views

How can I copy multiple files over scp in one command?

I have to transport a lot of files from one PC to another (both Linux). I would like to use scp for that, but scp only allows for transferring one file at a time. How can I do this? I have No ...
8
votes
3answers
9k views

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.
8
votes
2answers
2k views

FTPS versus SFTP versus SCP

I would like to know exactly what the difference is between the following protocols: FTPS, SFTP, and SCP. For instance Unix has an scp tool, FileZilla offers FTP and SFTP, whereas JetBrains PhpStorm ...
8
votes
4answers
16k views

scp'ing multiple files in one pass - to multiple destinations on one target server?

I would like to scp about a half dozen files in a couple directories to the same directories on a target machine. Without utilizing ssh keys, is this possible in one call? For example: scp ...
7
votes
4answers
8k views

SCP from one external server to another

I am trying to use SCP on my local server to copy a file from one remote server to another remote server (both remote servers use a custom port (xxxx) I am trying: scp -r -P xxxx ...
7
votes
1answer
19k views

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 .ssh directory and see that ...
7
votes
3answers
4k views

How to copy a sparse file using scp?

Do we have any option in scp that I could copy a sparse file ? The following command works with ssh, But I am looking for an option in SCP which copies a sparse file. tar -Szcf - /home/myself/test/ ...
6
votes
5answers
2k views

Windows equivalent of SSH

I don't know Windows very well and only vaguely know my way around the Command Prompt. Is there an equivalent to SSHing into another Windows computer via cmd? Equivalents to SCP and other Linux ...
6
votes
3answers
4k views

How to gzip a directory, transfer via scp, and decompress in one command?

I frequently transfer large directories over scp and it would be sweet if I could somehow compress the directory, send it, and decompress it all in one. Is something like this possible?
6
votes
3answers
8k views

Is it possible to rate-limit an scp/sftp/rsync/etc transfer from the command-line? ie, manual QoS on a single command?

Specifically, I am looking to rate-limit an scp or sftp session (or other arbitrary network call) in the call itself. For example, let's say I want to copy 100MB to one server, and 1GB to another. ...
6
votes
2answers
6k views

why is WinSCP so slow

the interface is handy but the file transfer rate is freakishly slow compared to pscp or scp in my VM on the same windows machine. i'm only getting about 17kb/s when my overall connection speed can go ...
6
votes
1answer
4k views

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 ...
6
votes
2answers
511 views

SCP recursive file transfer order

Wondering whether it's possible to specify a sort order when transferring files with scp. For example: $ scp -r "user@host:/path/to/download/" . [... files download in a seemingly random order ...] ...
5
votes
4answers
2k views

Are there other commands like scp but for deleting files and folders?

I am using scp to copy stuff to a remote location. But sometimes scp does not work as expected, I have found that sometimes the copy does not complete properly (possibly when I have added new files to ...
5
votes
4answers
7k views

bash: using scp in cron job fails, but runs succesfully when run from command line

I am trying to use scp in a bash script run by cron (I am running this on Ubuntu 10.0.4 LTS). The script works fine (i.e. transfers and copies file1 and file2 to/from the remote server, when I run it ...
5
votes
1answer
245 views

Why do you need to escape spaces when passing SCP filenames?

Anyone who's ever SCP'd knows that this probably doesn't work: scp foo.txt 'me@remote.net:foo bar.txt' For me on this one, I get: "ambiguous target". The man page for SCP doesn't explain why you ...
5
votes
3answers
2k views

Linux: Alternative to rsync? (ie, scp with resume)

I've been using rsync to automatically send files from one box to another, which is great compared to scp, since it supports resuming. However, when resuming a very large file (>10gb) rsync has to ...
5
votes
3answers
5k views

How can I resume a large scp file transfer when using port forwarding?

I have a machine a couple of hops away, and I need to set up port forwarding in order to transfer files. Edit: To be clear, the multiple hops are needed in order to access the remote machine. From ...
4
votes
3answers
9k views

scp doesn't work but 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 ...
4
votes
2answers
14k views

How to SCP from linux server to Windows client

I am Puttying into a linux machine and trying to copy a file down somewhere (anywhere) to my local machine. I figure SCP is the best candidate for the job but don't really care, so long as the ...
4
votes
2answers
2k views

scp between two remote hosts from my local

I have two remote hostes. host1-> 10.3.0.1 host2-> 10.3.0.2 Both are installed with ssh and scp. In my scanario, ssh and scp listen to port 22 in host1 and in host2 it is port 6969. Now, using my ...
4
votes
4answers
1k views

Is there a way to resume an interrupted scp of a file?

I'm occasionally downloading a very large file via scp and there's a small chance each time of the connection dropping and cutting the transfer mid-way. Is there a way to resume it?
4
votes
3answers
405 views

ssh: leave channel open for fast copies

I have a high latency connection to a remote system. I'm debugging a script on the remote system, and thus repeatedly copying a small file via scp. This is annoying because it has to re-authenticate ...
4
votes
2answers
3k views

WinSCP screws up line breaks in files – how do avoid?

I'm getting pretty sick of how WinSCP screws up line breaks. this is line 1 this is line 2 Gets turned into this is line 1 this is line 2 I could just use FileZilla for FTP and Putty for SCP (I ...
4
votes
3answers
3k views

How do I SCP a file through an intermediate server?

I'm using Ccygwin on WinXP (with the bash shell). I want to SCP a file from my localhost to a remote machine -- host2. However, I can only SSH to an intermediate machine -- host1, and then from ...
4
votes
2answers
9k views

How to perform SCP as a Sudo user [duplicate]

Possible Duplicate: scp to remote server with sudo What is the best way of doing SCP from one box to the other as a sudo user. There are two servers Server A 10.152.2.10 ...
4
votes
2answers
1k views

How can I scp when path and / or filename to copy has spaces?

I have in a remote remote_host a file like this: \home\user\path with spaces\filename with spaces.ext And I want to scp it to current dir .. How can I do that? Thanks!
4
votes
1answer
8k views

Is there a tool like WinSCP for MacOS?

I used to use WinSCP to log into my remote server. I need to login with an ssh key and move the files from and to the remote server. So far I have not find any tool with the same features for MacOS. ...
4
votes
1answer
3k views

Can I make scp ask before overwriting an existing file?

Is there a possibility (man scp didn't reveal any) to make scp interactive like cp -i? That is, scp asks, if the target exists, if it may overwrite it? If yes, does it work locally and remote? If ...
4
votes
2answers
1k views

scp hangs at 100%, before finishing

my scp commands do hang at 100% before the finish (some seconds), The output I get using -vvv is this: http://paste.pocoo.org/show/137504/ Any ideas?
4
votes
1answer
2k views

SFTP, SCP, Secure Webdav: which is the most suitable?

currently, I am hosting a webdav share setup in order to store files I need anywhere I am. It is available via HTTPS. Things are that I do not need all the HTTP machinery -i.e. my nginx http server ...
4
votes
2answers
169 views

SCP giving out a blank line and not transfering files

As said, an image is worth a thousand words: This blank line is weird. SSH works correctly. Some verbose mode shows me this: I just... scp never gave up on me. Looks like it did today.