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

learn more… | top users | synonyms

30
votes
2answers
17k views

How to use wildcards (*) when copying with scp?

Why can't I copy with scp when I'm using * characters in the path? scp SERVERNAME:/DIR/* . What configs do SCP need to allow * in the path? UPDATE: the problem is not on server side, pscp is ...
22
votes
3answers
17k views

Restricting an SSH/SCP/SFTP user to a directory

Is there a simple way to restrict an SCP/SFTP user to a directory? All methods that I've come across require me to set a chroot jail up by copying binaries, but I don't think that should be necessary. ...
20
votes
5answers
10k views

How can I best copy large numbers of small files over scp?

I have a directory that's got several gigabytes and several thousand small files. I want to copy it over the network with scp more than once. CPU time on the source and destination machines is cheap, ...
16
votes
2answers
5k views

Do you need a shell for SCP?

I'm allowing a friend a local account on my machine, exclusively for SCP. Can I specify his account's shell as /bin/true, or in any other way limit the account, while still allowing SCP?
15
votes
4answers
5k views

What's the difference between SFTP, SCP and FISH protocols?

I used to think SCP is a tool to copy files over SSH, and copying files over SSH is called SFTP, which is itself a synonym to FISH. But now as I was looking for a Total Commander plugin to do this in ...
15
votes
4answers
15k views

Is there ever a reason to use scp instead of rsync?

Is there a reason to use scp instead of rsync? I can see no reason for using scp ever again, rsync does everything that scp does, with more safety (can preserve symlinks etc).
14
votes
3answers
25k views

How to get full path of original file of a soft symbolic link?

I want to scp a file to a server. The file is a symbolic link, and actually what I want to do is copying the source file. Anyway I don't want to track source file's path manually, because it can be ...
12
votes
2answers
6k views

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 ...
11
votes
4answers
3k views

Does a `scp` transfer close when I close the shell?

I have scp transfer (from one remote server to another), that is quite big. So maybe I want close the computer from which I executed this command, will this end the transfer? I have ssh access to ...
9
votes
1answer
8k views

scp and compress at the same time, no intermediate save

What is the canonical way to: scp a file to a remote location compress the file in transit (tar or not, single file or whole folder, 7za or something else even more efficient) do the above without ...
8
votes
4answers
605 views

How do I copy a file from multiple servers to my local system?

We have multiple deployment of an application on servers such as app00, app01 and so on. I need to copy a single log file from all these servers onto my local mac so I can perform some grepping and ...
8
votes
4answers
37k views

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

Why does SCP hang on copying files larger than 1405 bytes?

I'm trying to copy a file from one of my local machines to a remote machine. Copying a file with size upto 1405 bytes works fine. When I try to scp a larger file, the file gets copied but the scp ...
8
votes
4answers
12k views

How to copy with SCP between two servers using key auth?

I can log in via SSH using key authentication to SERVER1 and SERVER2. However, I can't copy files between the two servers. Why? How can I copy between them? (the data that I have to copy is bigger ...
8
votes
2answers
4k views

User can't touch -t

When SCP'ing to my Fedora server, a user keeps getting errors about not being able to modify file timestamps ("set time: operation not permitted"). The user is not the owner of the file, but we cannot ...
7
votes
1answer
3k views

Command-line mv exclusion list

Is there a way to mv,cp, or any file operation such that I could specify all the files I don't want affected? For example, say I have a folder with the files file1, file2, and file3, and I want to ...
7
votes
2answers
203 views

Is it possible to make scp fail when you do a local copy?

Is it possible to make scp fail when you do a local copy? I find it annoying to accidently create files with names like 192.168.11.5 when I meant to type 192.168.11.5: and hence copying the file to ...
6
votes
2answers
2k views

Problem in secure copying (scp) filenames with spaces

I am trying to copy files using secure copy(scp). I am trying to execute the following command but I get error due to the space in the absolute path of the location of the directory. scp -r -P 8484 ...
6
votes
3answers
521 views

Send an email any time an SSH key is used

I have about 30 nearly-identical CentOS 6 servers that I need to be able to push out updated config files automatically using an rsa key to log in as root. Usually this will just be rsync, but ...
6
votes
1answer
110 views

scp command working in bash doesn't work in zsh

This command works fine in bash: bash-3.2$ scp luna4:/u/paige/maye/src/diviner/notebooks/plots/hk_* . hk_az.png 100% 126KB 126.0KB/s 00:00 ...
5
votes
3answers
393 views

Copying large tree from one machine to another, maintaining ownership

I am trying to copy a large folder structure between machines. I want to maintain the ownership/rights during the copy as it is not reasonable to 'fix' the privs afterwards. Therefore, I am using the ...
5
votes
3answers
14k views

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 <myuserid>@hostB:<path of file in B> . it says that: scp: <path of file in B>: No such file or directory But on ...
5
votes
2answers
270 views

Provide user name when using vim with scp

I was reading about SSH here http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html and found that you can use vim to directly modify a file on a remote server that you can ssh into. ...
5
votes
2answers
265 views

How to input a network file using scp to ffmpeg

My problem is this. I have access to a server that hosts many video files, most of them are very large and not well compressed. I intend to make a reduced quality smaller size copy of these on my ...
5
votes
2answers
447 views

How to disable the try again password in ssh command

I want the ssh command to only allow one chance in typing the password, if the password was wrong at the first time the ssh will return Permission denied (publickey......). Is there a flag that ...
5
votes
3answers
597 views

Tar piped to split piped to scp

So I'm trying to transfer a bunch of files via SCP. Some of these are too large to be stored on the recipient (Android phone, 4GB file size limit). The sender is almost out of space, so I can't ...
5
votes
2answers
3k views

Provide parameters to scp with xargs

When I run svn st | awk '{print $2}', I get: a.py b.py c.py Then I want to scp these files to a remote server. I have tried: svn st | awk '{print $2}' | xargs scp my_name@my_server:~/ But it ...
5
votes
1answer
3k views

how to scp in mc (and remember)?

I found that I can do scp in mc via cd /#sh:radek@firebird from the command line. Is there any way I can save this as a favorite? Maybe even with the password?
5
votes
2answers
2k views

Scp doesn't work in cron

Yeah, I know it's classic. I've googled it all around, but still it doesn't work. I have the following script: #First go to SVN repo folder cd $svnrepos # Just make sure we have write access to ...
5
votes
0answers
204 views

Copy file over existing SSH session? [duplicate]

Possible Duplicate: SSH easily copy file to local system Let's give the following example: I've connected to ssh user@myserver.com. I need to copy a local file over to the remote ...
4
votes
1answer
19k views

How do I use sftp to get a directory and all its contents? [duplicate]

When I try to use the command get from sftp, I get the error saying that it is not a normal file. Is there a way around this?
4
votes
2answers
3k views

How can I send single file to multiple remote sites at the same time?

Can scp be used to send a single file to multiple remote servers at the same time? If so, how? If not, what's the alternative?
4
votes
5answers
4k views

How to securely allow scp, but not ssh

I work from a Mac Book Pro (called foo). I have a server where my customers scp large files to. (called bar). I frequently ssh into bar, and scp a file (called buzz) to my Mac. bob@foo$ ssh bar ...
4
votes
5answers
479 views

Sftp interface to Scp

I have a linux based router that doesn't have the SFTP server installed. More specifically, when I sftp user@ipaddress I get a sh: /user/libexec/sftp-server: not found error. My interest isn't trying ...
4
votes
3answers
5k views

Copy over ssh and execute commands in one session [duplicate]

Possible Duplicate: Using an already established SSH channel Here is my sync script: ssh user@remote.host /etc/init.d/some_service stop scp user@remote.host:/var/some_service/events ...
4
votes
3answers
4k views

Execute remote script with local parameter value

How can I automatize this task? 1) You are at A. 2) You ssh into B. 3) You run a script at B, that needs a parameter known at A. First, I thought perhaps I could send the value when I opened the ...
4
votes
3answers
1k views

scp: localhost password not accepted

I'm attempting to copy a public key to a remote server. I'm logged in locally as [localname] and the key resides locally at ~/.ssh/. I'm also ssh'd into [remote.com] as [remotename], and attempting to ...
4
votes
3answers
2k views

SCP works, but SSH doesn't (over wifi)

As the title says, when I'm using wifi at my office, I'm able to copy files to and from my server using SCP, but for some reason SSH is non-responsive. It just hangs, doesn't print anything, and I ...
4
votes
1answer
70 views

Bash script for scp interpreting tilde (~) too soon

So, I just started a new C++ class that requires me to program in a Linux environment. I don't have Linux installed on my machine, but I do have OS X and I can ssh into a linux machine in the lab at ...
4
votes
1answer
570 views

Weird SSH/SCP progress meter behavior

I've got a very weird SSH behavior and it's making me a bit nervous. Basically the progress meter is totally bogus: so bogus that it's nearly useless. And I fear that there may be something else going ...
4
votes
2answers
342 views

SCP file between 2 servers that go through few servers

I want to copy a file from server-a to server-d but I can access server-d only from server-b and then to server-c. server-a can only access server-b, server-b can only access server-c, server-c can ...
4
votes
2answers
8k views

“Permission denied, try again” while transferring files with scp

I have two servers (A and B) and my local machine. I'm trying to transfer a file from server A to server B. From server A: scp ./backup.tar user@server.b:/home/public/ Permission denied, please try ...
4
votes
2answers
1k views

Copy files from remote server to local, ignoring existing files (rsync not available)

I would like to copy a directory of files from a remote server to my local machine. As it is a large number of files, the option of ignoring existing files is desirable. Unfortunately, rsync is not ...
4
votes
2answers
5k views

Output progess of the scp/sftp command to both standard out and a file on linux server

I am writing a release script, which uses scp/sftp to get the the file from a remote server, we want to log the output of this script to a release.log file as well. I am using "tee" to achieve this, ...
4
votes
1answer
44 views

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?
4
votes
2answers
102 views

ssh to a specific machine within a network [duplicate]

I'm frequently transferring files and operating programs via ssh, and often from home. The machine I usually work on is a desktop at work that I cannot ssh to directly unless I'm already connected to ...
4
votes
2answers
159 views

How to pipe a remote file to stdout over scp or sftp?

Using ssh, it is easy to print the contents of a file using ssh host 'cat file.txt' When ssh is disabled, and only SFTP is enabled, running the previous command gives the following error: ...
4
votes
3answers
3k views

scp from one remote server to another remote server

I have one big file on server one and I want to copy it to server two using scp. I have the keys setup properly and I can ssh/scp to both servers from my desktop. The file I need to copy is larger ...
4
votes
1answer
955 views

scp permission denied after 'hardening' with bastille

I recently 'hardened' two Ubuntu servers using Bastille, and now I get permission denied: scp whenever I try to scp files in. SSH login works fine. I've tried adding an /scp-dump folder with 777 ...
4
votes
2answers
4k views

Disable direct login for normal users (like oracle) in linux but allow scp and sftp?

Is it possible to disable direct login for normal users (like oracle) in linux but allow scp and sftp for that use?