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

scp remote file to local machine

as a part of script I'm trying to copy a file from remote site. But got an error. To me that sounds bit strange as everything sounds ok: #aaa="/path/to/some file with spaces(and brackets).txt" .... #scp user@example.com:"$aaa" /test/ bash: -c: line…
swap
  • 43
  • 1
  • 5
4
votes
3 answers

Linux to windows ssh/scp/sftp differential backup solutions?

Here is the setup: Large amounts of large files (many over 4gb, multiple TBs in total) in a simple tree structure that need to be backed up without compression from a handful of linux boxes to a windows backup server. Every day a few hundred gigs…
Carpe_Noctem
  • 43
  • 1
  • 4
4
votes
1 answer

The Right Way to setup SSH keys to automate scp

I want to setup SSH keys to automate scp jobs. My current assumption is that "automate" implies SSH keys without a password, but I am open to your suggestions. I did a lot of Googling before I asked this question. Here is what I found: Lots of…
kevinarpe
  • 191
  • 10
4
votes
9 answers

Is there a way to SSH / SCP to another server as a different user, via a script?

I need to automate a way to distribute files to many servers. The problem of course is I need to use a secure protocol (SSH or SCP) and the username / password on each server is different. The scenario is we have a master server a, with user a_prod…
Kevin K
  • 833
  • 1
  • 6
  • 8
4
votes
1 answer

How To set up SCP from localhost to remote Ubuntu server

I am trying to configure an ubuntu vps. I have set up ssh secure login using rsa public and private keys from a local machine. As well as disabling root login I have also set up iptables and configured to allow ports 80 and 22 (port 22 only from…
user866190
  • 209
  • 1
  • 2
  • 5
4
votes
3 answers

Test if login is an scp connection

I'm echo'ing various machine statistics on login, but this is problematic for SCP and SFTP, is there a shell variable I can test for?
atx
  • 1,281
  • 1
  • 9
  • 26
4
votes
2 answers

Upload a file using scp only if the file was updated/modified?

pscp is a very handful tool if you want to upload files to another server using SSH. The only problem is that it is not able to detect if the destination file is already updated (based on datetime). I don't want to upload the file again if the file…
sorin
  • 8,016
  • 24
  • 79
  • 103
3
votes
2 answers

Copying large snapshot images to remote storage Linux

I need to copy snapshots of virtual machines running on Proxmox (KVM) servers and copy the snapshots to offsite storage. Most snapshots are a few gb, but some are rather large, up to 200gb. I would prefer to compress and copy the snapshots in one…
Dokbua
  • 1,072
  • 1
  • 10
  • 19
3
votes
5 answers

Rsync to /dev/null overwrites it

I am seeing a random behavior when copying from one server to another using rsync to the /dev/null of the destination server. This is as part my network performance testing, and I want to avoid Disk I/O in my testings. I have the same script in all…
Eilbron
  • 31
  • 1
  • 2
3
votes
2 answers

Secure FTP/SCP "breaks" existing files while they are being transfered

Typically I upload updated files/scripts over Secure FTP to my server to replace existing copies of those files as I make changes. But this has the nasty behavior of writing directly to those files. This means that while the files are being…
DivideByHero
  • 371
  • 1
  • 3
  • 8
3
votes
1 answer

SSH works both ways, but scp and rsync only one way

I have been using SCP and rsync to transfer some files between two servers using SSH keys. Suddently SCP and rsync don't work anymore from server 1 to server 2. They don't give any error or information. Whenever I try to use them, they just hang.…
Alex Dumitru
  • 315
  • 2
  • 3
  • 8
3
votes
1 answer

How to maintain ssh connection for multiple scp transfers?

I'm using the scp command to copy files from my local machine (ArchLinux) to my server (CentOS 6.5). But for each scp command a new connection is established and although I'm using SSH keys for authentication the proccess is taking to much time. So,…
3
votes
1 answer

How to create a web upload user for SCP

I have a server running apache as webserver. I need two user accounts to upload web content via scp. As example a wordpress installation. When I configure those users, and upload the files they are owned by the user who uploaded them. In that case…
Gerhard
  • 86
  • 5
3
votes
2 answers

How to parallelize the for loop while scp the files?

I am running my below shell script from machineA which is copying the files machineB and machineC into machineA. If the files are not there in machineB, then it should be there in machineC. The below shell script will copy the files into TEST1 and…
arsenal
  • 217
  • 1
  • 4
  • 11
3
votes
12 answers

Secure File Transfer Site

I need to setup a site to share files with clients. Everything about it has to be secure so, I don't want to use straight FTP. The other requirement is that it has to be easy to use as the people that are going to be transferring files are by no…
user16639