Questions tagged [scp]

Secure Copy or SCP is a means of securely transferring computer files between a local host and a remote host or between two remote hosts. It is based on the Secure Shell (SSH) protocol.

The SCP protocol is a network protocol, based on the BSD RCP protocol, which supports file transfers between hosts on a network. SCP uses Secure Shell (SSH) for data transfer and utilizes the same mechanisms for authentication, thereby ensuring the authenticity and confidentiality of the data in transit. A client can send (upload) files to a server, optionally including their basic attributes (permissions, timestamps). Clients can also request files or directories from a server (download). SCP runs over TCP port 22 by default. Like RCP, there is no RFC that defines the specifics of the protocol.

Source: wikipedia

As per documentation of the most widespread implementation OpenSSH, the protocol is considered "outdated, inflexible and not readily fixed". Using more modern protocols like sftp and rsync for file transfer is recommended.

432 questions
5
votes
1 answer

scp - What do the "-d" and "-t" options do?

I ran into this post that suggests adding the following to .ssh/authorized_keys in order to force an scp command : no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,command="scp -v -r -d -t ~/CONTENT" ssh-rsa AAAAMYRSAKEY... The…
catanman
  • 172
  • 1
  • 6
5
votes
3 answers

Why is scp much slower than http?

I have an instance on Amazon EC2 which holds a large-ish file (~180MB). I need to copy that file to my local machine, so naturally I tried scp. After trying multiple times only to get max speeds of 20-30kb/s and dropped connections (only once did I…
Felix
  • 380
  • 3
  • 11
5
votes
3 answers

change scp default directory in `~/.ssh/config`

The scp (openssh) command accepts relative paths as host:path/ which are relative to the home directory on the host. I would like to change location of the default directory. For example, I would like to create a shortcut pseudo-host in .ssh/config…
eudoxos
  • 363
  • 2
  • 3
  • 11
5
votes
3 answers

How to copy large (> 1 million) number of small files between two servers

I need to migrate about 1TB of data comprised of smaller files (most under 100KB) to another server. I've not even completely enumerated the files but estimates are between 1-2 million. The initial copy using SCP took over a week. Now we have to…
jeffatrackaid
  • 4,142
  • 19
  • 22
5
votes
4 answers

WinSCP - SCP is working and SFTP is not working

I am trying to connect to our remote server using winSCP. It was working before. But from today I am not able to connect to the server using SFTP. If I changed the protocol to SCP, then I am able to connect. Also I am able to connect using…
Steve
  • 73
  • 1
  • 1
  • 3
5
votes
2 answers

scp and rsync do not work (ssh works)

In my Debian Squeeze server, scp and rsync do not seem to copy over anything. Works fine with another server though (so not a client problem). When using scp, it just creates an empty file and waits. /etc/bash.bashrc contains [ -z "$PS1" ] && return…
5
votes
2 answers

Ubuntu SCP copy stalls

I have problem copying files to cloud servers with SCP from my office. When I do scp of 17MB war file it says STALLED and then reconnect and again says stalled like the one below: #scp Desktop/myapp.war user1@204.x.x.x:/tmp/ user1@204.x.x.x's…
user53864
  • 1,723
  • 11
  • 37
  • 66
5
votes
2 answers

How do you use SCP to copy a deep directory?

I need to copy a deep directory on one windows machine over 'itself' on another windows machine. I can't seem to get the command to work correctly. The current problem is that it appears that scp is stripping the slashes out of the source…
Lance Roberts
  • 401
  • 3
  • 12
  • 29
5
votes
4 answers

How to copy a 200GB file faster?

I got a 200GB .tgz file on server A(RHEL 5.2). I wanna transfer that file to server B (RHEL 5.3). Server B is on ESXi 4 Update1. Server B VM is with 4 vCPUs, with 10GB RAM. Both Server A and Server B are connected with an ethernet cable with local…
RainDoctor
  • 4,422
  • 3
  • 23
  • 25
4
votes
1 answer

scp with special username

I'm trying to create a shell script for copying files to a remote backup. This is my script so far: PASSWORD=MY-SECRET-PASS URL=SLOS755513-3:SL1255513@objectstorage.net DIR=/backup scp /home/user/my_log.txt $URL:$DIR But I'm getting the…
Alfred Balle
  • 409
  • 3
  • 9
  • 22
4
votes
1 answer

How can I create a Single-purpose keys (ssh) for use with scp?

I'm trying to setup a Single-purpose key for copying data to a remote server (using scp), but I'm not sure what the command="" on the key should look like in this case. Any ideas? Thanks!
Robert Gould
  • 143
  • 5
4
votes
6 answers

How to download a file on a server you've already ssh'ed into?

I know how to use scp or wget to download a file on a remote server to my local machine. However, if I'm already logged into a server with ssh, is there a command that lets me download a file in the pwd on the server onto my local machine? I…
Wilhelm
  • 153
  • 2
  • 6
4
votes
3 answers

Debian Permit Local Command Issue

I have a debian box that I cannot scp files from. Installing ssh again does not fix this issue hosting:/home/gcushing# scp test.text gcushing@serenity.gwi:/home/gcushing command-line: line 0: Bad configuration option: PermitLocalCommand lost…
user19039
4
votes
2 answers

Replace scp with sftp

We have a few synchronization scripts for a client sending files, using scp, to a remote server administered by one of their providers. Recently they closed it, and the new one they provided doesn't permit scp, only sftp (there is no way to get a…
Ulrar
  • 387
  • 6
  • 23
4
votes
2 answers

include/exclude files for "scp -r"

Supposed local folder as below: /test/subfolder /test/subfolder/file1.txt /test/subfolder/page1.htm /test/subfolder/page2.htm /test/.hiddenfolder /test/./hidenfolder/file2 How to exclude .hiddenfolder to be transfer when executing "scp -r test…
jack
  • 1,725
  • 5
  • 21
  • 25