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

FTP, SCP or something else

I've just got my own virtual server running Windows Server 2008 and I'm setting it up. However, I'm far from an expert and I'm not sure about a few things. I want to be able to move files to and from my server and I was wondering what the best way…
Richard
  • 272
  • 4
  • 18
2
votes
5 answers

How to copy directory from one Linux server to another with a minimum in-between period?

I have a rather big directory on one server (over 4000 files), which I'd like to copy to another server (which contains a previous version of this directory). rsync is the first option, but it will put the destination folder into waiting status for…
yegor256
  • 1,836
  • 3
  • 16
  • 30
2
votes
1 answer

Limit scp (with sshd on centos) speed / rate

I'd like to let users download / upload files via scp to my centos 6.0 system, it's connected to lan via Gigabit ethernet, but I don't want transfers to flow at that speed. I want to limit the speed to 10Mb/s. I have managed to find the right…
eitama
  • 131
  • 4
2
votes
1 answer

Why does scp -scp work but not scp without that flag

when I try and scp to my solaris box, I get this unable to initialise SFTP: could not connect unless I do scp -scp then it works. In my sshd_config file, I have this: Subsystem sftp /usr/local/libexec/sftp-server
Stu
  • 2,198
  • 2
  • 16
  • 23
2
votes
3 answers

VMware seems to throttle SCP copies, what can be the reason?

I seem to have a strange issue with my VMware cluster, where I get inconsistent SCP transfer rates. I have Cluster1 and Cluster2, physically in different regions. I need to transfer large vmdk from Cluster1 to Cluster2. Here is what I get: SCP from…
Sergey
  • 948
  • 5
  • 10
  • 22
2
votes
2 answers

Using command in ssh authorized_keys breaks scp

I would like to use command per key in authorized_keys to set some environment variables. command="MYVAR=test $SHELL" ssh-rsa mykey Shell works fine but scp is not working. What would be the correct way to set environment variables per key and not…
Laurynas
  • 121
  • 1
  • 3
2
votes
3 answers

Force SFTP/SCP to copy files with a remote directory's permission

I am having a problem with SFTP and SCP where files that are copied are not inheriting the permissions of the remote parent directory. I have seen similar questions on serverfault where the umask of the SFTP/SCP session is modified, however, that…
Phanto
  • 891
  • 5
  • 16
  • 24
2
votes
3 answers

How do I SCP keypairs from one Amazon EC2 instance to another instance?

I am trying to SCP cert. between my two instance and having some trouble. Here is what I am entering. [ec2-user@ip-xxx-xx-xx-xx ~] scp -i .ssh/key.pem /root/.ssh/id_rsa.pub 10.xxx.xx.xxx:/root/.ssh/authorized_keys2 returns /root/.ssh/id_rsa.pub:…
Maca
  • 1,043
  • 2
  • 19
  • 30
2
votes
1 answer

getting a list of files from secure server

i am trying to get a list of files from secure server to compare them (using diff) to the ones i modified on local version (unfortunately the company i work in is not using subversion nor git yet) i get list of files easily with: find . -mtime -20 |…
Pavel K.
  • 297
  • 3
  • 8
2
votes
3 answers

How to avoid stalled scp transfer when tunneling through a gateway over ssh?

I'm try to transfer a large (1GB+) file from one machine to another, but I have to tunnel through a gateway in between. I'm able to transfer small files just fine. However, with the big file, the transfer stalls mid-way through. After reading a blog…
Matt V.
  • 837
  • 1
  • 9
  • 12
2
votes
2 answers

User created MOTD prevents SCP from functioning

I've created custom MOTDs to be displayed at login via SSH by doing the following: create a text file in /etc/usermotd/ with the message inside Edit the user's .bashrc file and put the following code: if [ -f /etc/usermotd/`whoami` ];…
Safado
  • 4,786
  • 7
  • 37
  • 54
2
votes
3 answers

Why does SCP write 0 bytes in this case?

I'm trying to copy my ssh key from my local vm to another box, everything seems to work ok, but when I check the remote box the file isnt there... Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.0 seconds scp doesnt look it's writing anything,…
qodeninja
  • 2,753
  • 10
  • 32
  • 33
2
votes
2 answers

Transfer large files over the internet from a Linux VPS to Windows machine

I regularly need to transfer files that are a few gigabytes in size from a Linux VPS to my home Windows machine. I am trying to find a transfer method that fits my needs. FTP/SFTP works but is quite slow in comparison to other methods, SCP is fast…
Ben
  • 237
  • 1
  • 2
  • 6
2
votes
2 answers

Compare & Copy missing files from identical directory on Remote Server

I have a development server on which I want to keep certain data directories in sync with the live server. Any files in these directories which exist on the live server, but not on the dev server, I need to copy over. Because I don't care about…
Brian Lacy
  • 1,113
  • 4
  • 15
  • 23
2
votes
3 answers

Copy a file from remote to local

I am trying to copy a file from 10.10.10.99:/home/shantanu/ to the localhost. The only problem is that I need to tunnel the connection through 10.10.10.98 Something like this does not work.... ssh shantanu@10.10.10.98 "ssh shantanu@10.10.10.99 cp…
shantanuo
  • 3,579
  • 8
  • 49
  • 66