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
73
votes
16 answers

How can I fix "kex_exchange_identification: read: Connection reset by peer"?

I want to copy data with scp in a GitLab pipeline using PRIVATE_KEY. The error is: kex_exchange_identification: read: Connection reset by peer Connection reset by x.x.x.x port 22 lost connection Pipeline log: $ mkdir -p ~/.ssh $ echo…
Mohammad Reza Mousavi
  • 894
  • 1
  • 10
  • 18
71
votes
3 answers

Error when using scp command "bash: scp: command not found"

I want to use scp command to copy a local file to remote server, but I get an error message after input the password of user in remote server. ~]$ scp gitadmin.pub git@123.150.207.18: git@123.150.207.18's password: bash: scp: command not found lost…
Rivers Yang
  • 721
  • 1
  • 5
  • 4
70
votes
3 answers

Using putty to scp from windows to Linux

I'm trying to test some C code that I'm writing. The only issue is that the code needs to be executed on a remote machine. My laptop is pretty old, and there is no driver for my wireless card available for Ubuntu, so booting into Linux to…
Chris Phillips
  • 1,997
  • 2
  • 19
  • 34
70
votes
8 answers

rsync - create all missing parent directories?

I'm looking for an rsync-like program which will create any missing parent directories on the remote side. For example, if I have /top/a/b/c/d on one server and only /top/a exists on the remote server, I want to copy d to the remote server and have…
ErikR
  • 51,541
  • 9
  • 73
  • 124
60
votes
12 answers

scp files from local to remote machine error: no such file or directory

I want to be able to transfer a directory and all its files from my local machine to my remote one. I dont use SCP much so I am a bit confused. I am connected to my remote machine via ssh and I typed in the command scp…
Liondancer
  • 15,721
  • 51
  • 149
  • 255
60
votes
2 answers

How can I scp a file with a colon in the file name?

I'm trying to copy a file using scp in bash with a colon (:) character in the source filename. The obfuscated version of my command I'm using is: scp file\:\ name.mp4 user@host:"/path/to/dest" I get this error: ssh: Could not resolve hostname…
Nathan Jones
  • 4,904
  • 9
  • 44
  • 70
59
votes
4 answers

How to scp back to local when I've already sshed into remote machine?

Often I face this situation: I sshed into a remote server and ran some programs, and I want to copy their output files back to my local machine. What I do is remember the file path on remote machine, exit the connection, then scp…
laike9m
  • 18,344
  • 20
  • 107
  • 140
58
votes
8 answers

scp gives "not a regular file"

I have a problem when using scp on Linux, it says "not a regular file". I looked at other questions/answers about that, but I can't find out what's wrong... I wrote: scp aa@aa:/home/pictures/file.fits . to copy file.fits from aa@aa, /home/pictures…
Fourmicroonde
  • 591
  • 1
  • 4
  • 3
58
votes
6 answers

How do I create a directory on remote host if it doesn't exist without ssh-ing in?

I'm not sure if this is possible or not. Basically, I'm writing a script that allows me to scp a file to my hosting. This is it so far. Argument 1 is the file and argument 2 is the folder I want it to be placed in on the remote server: function…
larjudge
  • 1,913
  • 4
  • 14
  • 13
56
votes
6 answers

Git fetch/pull/clone hangs on receiving objects

When fetching or pulling from git repositories, or cloning a repository, I get to this point: remote: Counting objects: 6666, done. remote: Compressing objects: 100% (5941/5941), done. Receiving objects: 23% (1534/6460), 11.68 MiB | 23 KiB/s …
gabeb
  • 669
  • 1
  • 6
  • 8
55
votes
3 answers

Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel

Per the title, I'm getting the following warning when I try to scp through an ssh tunnel. In my case, I cannot scp directly to foo because port 1234 on device foo is being forwarded to another machine bar on a private network (and bar is the machine…
jonderry
  • 23,013
  • 32
  • 104
  • 171
54
votes
4 answers

using ssh keys with scp and ssh

I am trying to copy few files to a target system using scp and then login to the system and install those files. I used scp and ssh commands here with ssh keys for passwordless authentication. The ssh key was created on the source system as below.…
user3721640
  • 777
  • 2
  • 11
  • 15
54
votes
4 answers

Use ssh from Windows command prompt

Question: How to use ssh & scp from the Windows command prompt? I remember I installed a program in the past that let me do this but can't remember now what it was. Note: I do not want to use putty.
hoju
  • 28,392
  • 37
  • 134
  • 178
54
votes
4 answers

scp copy directory to another server with private key auth

is there something wrong with this scp command ? scp -C -i ./remoteServerKey.ppk -r /var/www/* root@192.168.0.15:/var/www I use the same .ppk as in putty and enter the same passphrase, but it asks me 3 times and than says connection denied. I…
user2693017
  • 1,750
  • 6
  • 24
  • 50
53
votes
4 answers

How to copy a file from remote server to local machine?

In my terminal shell, I ssh'ed into a remote server, and I cd to the directory I want. Now in this directory, there is a file called table that I want to copy to my local machine /home/me/Desktop. How can I do this? I tried scp table…
omega
  • 40,311
  • 81
  • 251
  • 474