Questions tagged [scp]

For questions around "Secure Copy Protocol" (SCP). GENERAL SCP SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. Secure Copy Protocol or SCP is a means of securely transferring computer files between a local and a remote host or between two remote hosts over an SSH protocol. This tag is NOT related to "SAP Cloud Platform"!

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

The term SCP can refer to one of two related things, the SCP protocol or the OpenSSH scp program.

Source: Wikipedia (Secure copy)

1861 questions
31
votes
1 answer

Timeout in paramiko (python)

I'm looking for a way to set a timeout for this: transport = paramiko.Transport((host, port)) transport.connect(username = username, password = password) sftp = paramiko.SFTPClient.from_transport(transport) sftp.get(remotepath,…
Kukosk
  • 2,892
  • 1
  • 27
  • 30
31
votes
8 answers

scp not working saying its a directory error

I am trying to copy a file to remote server in a certain folder. Its an adrive backup plan. But it comes with scp. I can copy the file if I don't select directory. Even if I put a directory that doesn't exist it says its a directory. root@host1…
user4603311
30
votes
7 answers

How to scp to Amazon s3?

I need to send backup files of ~2TB to S3. I guess the most hassle-free option would be Linux scp command (have difficulty with s3cmd and don't want an overkill java/RoR to do so). However I am not sure whether it is possible: How to use S3's…
qliq
  • 11,695
  • 15
  • 54
  • 66
28
votes
4 answers

Shellscript action if two files are different

I am importing a file to my server using this command: scp zumodo@shold:/test/test/test/server.py /test/test/test/test.py~/; I want to restart my server if the newly imported file test.py~ differs from the test.py that already exists. How would I…
Spencer
  • 21,348
  • 34
  • 85
  • 121
28
votes
6 answers

Transferring a file to an amazon ec2 instance using scp always gives me permission denied (publickey,gssapi-with-mic)

I am trying to transfer a file to an ec2 instance. I followed the Amazon's documentation, this is what my command looked like: scp -i [the key's location] Documents/[the file's location] ec2-user@[public dns]:[home/[destination]] where I replaced…
Amre
  • 1,630
  • 8
  • 29
  • 41
26
votes
2 answers

scp a folder to a remote system keeping the directory layout

I have a large directory tree with hundreds of nested sub-folders. I need to copy only 4 folders and their contents to a remote system, but I need to destination folder structure to be kept the…
Chris
  • 2,655
  • 2
  • 18
  • 22
25
votes
3 answers

passing yes argument while scp command

I am facing an issue when I run simply these commands. The remote server want to pass yes to add the key in RSA file because first time connection established with scp. commands are given below #!/bin/bash scp -P58222 root@IP:/root/K…
Harry shah
  • 387
  • 1
  • 3
  • 9
24
votes
3 answers

How to enable sshpass output to console

Using scp and interactively entering the password the file copy progress is sent to the console but there is no console output when using sshpass in a script to scp files. $ sshpass -p [password] scp [file] root@[ip]:/[dir] It seems sshpass is…
jacknad
  • 13,483
  • 40
  • 124
  • 194
24
votes
6 answers

How to transfer a file between two remote servers using scp from a third, local machine?

I'm trying to copy a file from one remote server to another remote server from my local machine. Here's what I'm trying to do localA $ scp userB@remoteB:/path/to/file userC@remoteC:/path The problem is that I need to pass two passwords for both…
Alan
  • 1,479
  • 3
  • 20
  • 36
23
votes
4 answers

mtime.sec is not present

I am facing a tricky situation here. I have a java based application that tries to scp remote machines to copy certain files. While performing those tasks , I am finding the below error message from the application side. scp protocol error mtime.sec…
skanagasabap
  • 910
  • 3
  • 12
  • 24
23
votes
10 answers

How to best capture and log scp output?

I am trying to capture output from an install script (that uses scp) and log it. However, I am not getting everything that scp is printing out, namely, the progress bar. screen output: Copying /user2/cdb/builds/tmp/uat/myfiles/* to server…
caseyboardman
  • 799
  • 2
  • 11
  • 26
23
votes
3 answers

How can I get a folder from remote machine to local machine?

I am trying scp -r usernameipaddress:/path /pathwhereIwanttocopy, but I am getting it as connection refused. How can I get it? How can I get connected?
Nilesh Agrawal
  • 3,002
  • 10
  • 26
  • 54
21
votes
2 answers

Library to do SCP for C#

Is there a library that provides the ability to do SCP transfers in C#?
Malfist
  • 31,179
  • 61
  • 182
  • 269
21
votes
7 answers

SCP File from local to Heroku Server

I'd like to copy my config.yml file from my local django app directory to my heroku server, but I'm not sure how to get the user@host.com format for heroku. I've tried running 'heroku run bash' scp /home/user/app/config.yml I'm not sure how I can…
user2738206
  • 388
  • 2
  • 4
  • 14
21
votes
5 answers

Is there a SCP alternative for PowerShell?

I need to write a script that transfers files from a folder onto another server (Linux), but the script that's transferring files is on windows, and I was wondering if there was an alternative to scp for PowerShell (or if there was another way of…
Saad
  • 26,316
  • 15
  • 48
  • 69