Questions tagged [scp]
SCP (Secure Copy) is a secure protocol based on SSH used for transferring files between computers.
735
questions
213
votes
7
answers
208k
views
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 ...
199
votes
5
answers
220k
views
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?
138
votes
7
answers
292k
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 ...
138
votes
6
answers
154k
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 ...
111
votes
6
answers
99k
views
scp with zsh : no matches found
when I try scp over zsh, I get
scp hostA:Descargas/debian-6.0.4-* [email protected]:Escritorio/Software/
zsh: no matches found: hostA:Descargas/debian-6.0.4-*
the same command work in bash
93
votes
9
answers
251k
views
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 ...
90
votes
3
answers
77k
views
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 ...
88
votes
7
answers
86k
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 (...
86
votes
5
answers
125k
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.
68
votes
6
answers
101k
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?
Note! The question is about a fresh ...
67
votes
13
answers
135k
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 target....
67
votes
10
answers
52k
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 ...
66
votes
2
answers
98k
views
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:
...
63
votes
4
answers
205k
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 the .ssh directory and saw ...
63
votes
4
answers
226k
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 ...
61
votes
8
answers
123k
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 ...
57
votes
3
answers
288k
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 ...
56
votes
5
answers
57k
views
Rsync files via intermediate host
I am currently away from my LAN and I need to do a backup of my laptop. I have a somewhat recent copy of my laptop on my server and I usually back the laptop up using rsync. Now I wish to do that, but ...
50
votes
3
answers
49k
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 ...
45
votes
11
answers
433k
views
How to SCP from Linux server to Windows client
I'm SSHing into a Linux machine using PuTTY 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 ...
43
votes
6
answers
40k
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 ...
42
votes
17
answers
104k
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 ...
38
votes
4
answers
66k
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 ...
37
votes
4
answers
76k
views
Allow incoming SCP connections on Mac
How can I allow incoming scp connections on my 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.
...
34
votes
8
answers
99k
views
scp a single file to multiple locations
Can you scp a file to multiple locations in the same command?
For example:
scp file.txt [email protected]:, [email protected]:
Or would it be more practical to create a bash script that has all the hosts ...
33
votes
4
answers
165k
views
Is there a tool like WinSCP for MacOS? [closed]
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.
...
31
votes
6
answers
16k
views
Can the server admin see what I copy via SCP?
Say I am connecting to a server via SCP and copying some files from the remote server to my home computer. Can the server admins tell that I have copied something, see what was copied, or know who ...
31
votes
8
answers
45k
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?
30
votes
6
answers
70k
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 ...
30
votes
7
answers
95k
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 ...
29
votes
2
answers
33k
views
scp: error: unexpected filename:
An SCP I've been using for a long time to upload files has suddenly stopped working. I ran the script 12 hours ago and it worked just fine, but has suddenly stopped.
The command in question was ...
25
votes
2
answers
52k
views
scp + copy the symlinks
Why does the scp command not copy links from the local computer to the other?
scp -rp dir linux:/dir_target
How can I copy the links when in the source directory I have both files and links?
24
votes
9
answers
95k
views
SSH from Windows to Linux without entering a password
I am trying to use ssh/scp from Windows to Linux without having to enter a password.
This is what I have done, and it doesn't seem to work:
generated public and private keys using Putty Key ...
23
votes
6
answers
348k
views
How do I transfer a file to my server using PuTTY?
when calling SCP in PuTTY on my Win7 box, it doesn't let me use C:/, but I also have no idea where on my local machine it will look for files by default. None of program directory or user directory ...
20
votes
11
answers
125k
views
WinSCP client for Ubuntu [closed]
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 ...
20
votes
1
answer
38k
views
Preserve ctime with SCP
How can I copy a file using SCP while preserving ctime (modification time)?
I have a folder on my Mac (OS 10.8), and the results of ls -l and ls -lc are the same.
$ ls -l
total 0
drwxr-xr-x 9 ...
20
votes
2
answers
26k
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 ...
19
votes
3
answers
17k
views
Scp the current dir `.` to another name
This is an edge use case, but I can't find a solution.
I want to copy the current directory ., without necessarily knowing or caring for its name, to a new directory. Using scp.
Bash does not seem ...
19
votes
5
answers
22k
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 ...
18
votes
4
answers
16k
views
Unable to use scp with a bash alias
This code does not work:
scp ~/Desktop/favicon.ico nameOfBashAlias:/public_html/mySite/templates/blog/
The alias is:
alias nameOfBashAlias='ssh [email protected]'
How do I solve this ...
18
votes
1
answer
36k
views
scp -q isn't quiet between different hosts
So scp -q file host:file and scp -q host:file file are both quiet, i.e. don't give the progress meter. But when I run scp -q host1:file host2:file, I still get the progress meter as well as a ...
18
votes
1
answer
95k
views
"No such file or directory" error when attempting to copy (using scp) from remote host to local machine
I am attempting to copy a file (/home4/user/public_html/website.com/folder_1/folder_2/file_to_copy.zip) from my remote host to my local machine's desktop (/Users/username/Desktop) using the scp ...
16
votes
4
answers
22k
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/ ...
15
votes
5
answers
35k
views
Using scp to transfer a .txt file list of files
I have 1.6 million files on server A, and only about 20k of them need to get to server B. The destination, server B, is on GoDaddy shared hosting, so I'm just about limited to scp for transferring ...
15
votes
5
answers
164k
views
How to use PSCP to copy file from Unix machine to Windows machine where target path has spaces?
I am having a problem using PSCP in a C# program to copy a file from a Unix machine to a Windows machine. The problem only happens when the target folder on the Windows machine has a space in it. ...
15
votes
5
answers
34k
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 ...
15
votes
4
answers
9k
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 ...
15
votes
2
answers
16k
views
Why does rsync over SSH give me 10x the throughput of SCP?
scp user@aws-ec2:~/file file
rsync --partial --progress -Pav -e ssh user@aws-ec2:~/file file
scp only gives me 200K/s, but rsync gives me 1.9M/s
I tested several times, all same results.
rsync ...
15
votes
4
answers
93k
views
scp "lost connection" but ssh works fine
A server I can ssh into fine has begun refusing to scp.
$ scp ~/tmp/foo [email protected]:~/tmp/
lost connection
With scp -v -v I can see the connection succeeds and the transfer appears to ...
14
votes
3
answers
24k
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 ...