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
3343
votes
14 answers

How do I copy a folder from remote to local using scp?

How do I copy a folder from remote to local host using scp? I use ssh to log in to my server. Then, I would like to copy the remote folder foo to local /home/user/Desktop. How do I achieve this?
Slasengger
  • 33,707
  • 3
  • 14
  • 10
1090
votes
14 answers

scp with port number specified

I'm trying to scp a file from a remote server to my local machine. Only port 80 is accessible. I tried: scp -p 80 username@www.myserver.com:/root/file.txt . but got this error: cp: 80: No such file or directory How do I specify the port number in a…
One Two Three
  • 22,327
  • 24
  • 73
  • 114
494
votes
15 answers

scp (secure copy) to ec2 instance without password

I have an EC2 instance running (FreeBSD 9 AMI ami-8cce3fe5), and I can ssh into it using my amazon-created key file without password prompt, no problem. However, when I want to copy a file to the instance using scp I am asked to enter a…
Hoff
  • 38,776
  • 17
  • 74
  • 99
492
votes
4 answers

Transferring files over SSH

I'm SSHing into a remote server on the command line, and trying to copy a directory onto my local machine with the scp command. However, the remote server returns this "usage" message: [Stewart:console/ebooks/discostat] jmm% scp -p ./styles/ usage:…
Josh Maurice
477
votes
19 answers

scp or sftp copy multiple files with single command

I'd like to copy files from/to remote server in different directories. For example, I want to run these 4 commands at once. scp remote:A/1.txt local:A/1.txt scp remote:A/2.txt local:A/2.txt scp remote:B/1.txt local:B/1.txt scp remote:C/1.txt…
user987654
  • 5,461
  • 5
  • 23
  • 26
441
votes
22 answers

How to pass password to scp?

I know it is not recommended, but is it at all possible to pass the user's password to scp? I'd like to copy a file via scp as part of a batch job and the receiving server does, of course, need a password and, no, I cannot easily change that to…
Argelbargel
  • 5,840
  • 2
  • 23
  • 16
435
votes
13 answers

How do I escape spaces in path for scp copy in Linux?

I want to copy a file from remote to local system. Now I'm using scp command in linux system. I have some folders or files names are with spaces, when I try to copy that file, it shows the error message: "No such file or directory". I tried: scp…
AlexPandiyan
  • 4,467
  • 2
  • 14
  • 11
351
votes
7 answers

How does `scp` differ from `rsync`?

An article about setting up Ghost blogging says to use scp to copy from my local machine to a remote server: scp -r ghost-0.3 root@*your-server-ip*:~/ However, Railscast 339: Chef Solo Basics uses scp to copy in the opposite direction (from the…
Leahcim
  • 40,649
  • 59
  • 195
  • 334
277
votes
18 answers

Using scp to copy a file to Amazon EC2 instance?

I am trying to use my Mac Terminal to scp a file from Downloads (phpMyAdmin I downloaded online) to my Amazon EC2 instance. The command I used was: scp -i myAmazonKey.pem phpMyAdmin-3.4.5-all-languages.tar.gz …
HoKy22
  • 4,057
  • 8
  • 33
  • 54
243
votes
15 answers

Is there a WinSCP equivalent for Linux?

I love WinSCP for Windows. What is the best equivalent software for Linux? I tried to use sshfs to mount the remote file system on my local machine, but it is not as user friendly as simply launching a GUI, plus it seems to require root access on…
MiniQuark
  • 46,633
  • 36
  • 147
  • 183
218
votes
13 answers

How to scp in Python?

What's the most pythonic way to scp a file in Python? The only route I'm aware of is os.system('scp "%s" "%s:%s"' % (localfile, remotehost, remotefile) ) which is a hack, and which doesn't work outside Linux-like systems, and which needs help…
Michael Gundlach
  • 106,555
  • 11
  • 37
  • 41
192
votes
5 answers

Copying files from server to local computer using SSH

I am having trouble copying files from a remote server using SSH. Using PuTTY I log in to the server using SSH. Once I find the file I would like to copy over to my computer, I use the command: scp username@host.com:/dir/of/file.txt \local\dir\ It…
Vincent
  • 1,933
  • 2
  • 11
  • 6
172
votes
2 answers

How Can I Download a File from EC2

What scp arguments should I use to download a file from an Amazon EC2 instance to local storage?
user1226621
  • 1,745
  • 2
  • 11
  • 6
165
votes
7 answers

How to resume scp with partially copied files?

I'm using the scp shell command to copy huge folder of files. But at some point in time I had to kill the running command (by Ctrl+C or kill). To my understanding scp copies files sequentially, so there should be only one partially copied file. How…
Bohdan
  • 16,531
  • 16
  • 74
  • 68
143
votes
14 answers

How to copy a file to a remote server in Python using SCP or SSH?

I have a text file on my local machine that is generated by a daily Python script run in cron. I would like to add a bit of code to have that file sent securely to my server over SSH.
Alok
  • 1,441
  • 2
  • 10
  • 4
1
2 3
99 100