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.

428 questions
752
votes
9 answers

Can scp copy directories recursively?

Currently I can only copy a single .tar file. But how can I copy directories recursively with scp?
kernel
  • 8,211
  • 5
  • 18
  • 14
99
votes
10 answers

How do I do Multihop SCP transfers between machines?

I want to copy a file from my machine A to server C, but only have access to server C through server B. Instead of first transferring to server B, log in and then transfer to server C, Is is possible to transfer the file directly with SCP or similar…
sverrejoh
  • 1,091
  • 1
  • 8
  • 4
88
votes
2 answers

scp without known_hosts check

Is there any chance to skip the known_hosts check without clearing known_hosts or disable it in ssh.conf? I neither have access to known_hosts nor ssh.conf yet. Don't find any suitable in man.
burnersk
  • 1,966
  • 4
  • 25
  • 38
77
votes
9 answers

How to make scp copy hidden files?

I often use SCP to copy files around - particularly web-related files. The problem is that whenever I do this, I can't get my command to copy hidden files (eg, .htaccess). I typically invoke this: scp -rp src/ user@server:dest/ This doesn't copy…
rascher
  • 1,056
  • 3
  • 13
  • 14
73
votes
10 answers

Allow SCP but not actual login using SSH

Is there any way to configure a user on a Linux box (Centos 5.2 in this case) so that they can use scp to retrieve files, but can't actually login to the server using SSH?
DrStalker
  • 6,676
  • 24
  • 76
  • 106
72
votes
8 answers

Quickest way to transfer 55GB of images to new server

I currently have two CentOS servers. I need to know how and what the quickest way would be to "tar" up the images directory and SCP it over? Is that the quickest way that I just suggested, because tarring is taking forever... I ran the command: tar…
Andrew Fashion
  • 1,635
  • 7
  • 22
  • 26
60
votes
7 answers

How to _MOVE_ files with scp?

How to not copy but move files from one server to another (both Linux)? man scp didn't give me anything useful. I cannot use 'scp' then 'rm' because I must make sure the file is successfully transferred. If there is any error during transfer, the…
Putnik
  • 2,095
  • 3
  • 23
  • 40
60
votes
6 answers

How to pass password to scp command used in bash script?

Possible Duplicate: Connect through SSH and type in password automatically, without using a public key I have a bash script that makes dump of DB then copies file from one server to another but it always asks for password before connection. scp…
chubbyk
  • 863
  • 2
  • 10
  • 15
46
votes
4 answers

PSCP: Upload an entire folder, Windows to Linux

I am using PSCP to upload some files from Windows to Linux. I can do it fine just uploading one file at a time. But I have some very large directories and I want to upload an entire directory at once. I have tried: pscp -i…
Mechlar
  • 607
  • 1
  • 7
  • 10
39
votes
4 answers

FTP/FTPS/SFTP/SCP - Speed comparison

How do FTP, FTPS, SFTP, and SCP compare in terms of transfer rate and how can I compare them through testing?
Graham
  • 399
  • 1
  • 3
  • 3
37
votes
2 answers

preserve permission with scp

SCP does not seem to preserve ownership stamps even if used with -p option. scp -p /mysql/serv/data_summary.* some_server:/mysql/test/ The files are owned by mysql and I want the same ownership to be assigned on the destination server. I need to…
shantanuo
  • 3,459
  • 8
  • 47
  • 64
37
votes
4 answers

Can I scp a folder that has sub folders?

I have a folder that contains files for a static website like: /site/index.html /site/css/css.css /site/js/js.js /site/images/... If I update something on my laptop, I want a single command to send the files off to my ubuntu server. I don't want…
Blankman
  • 2,841
  • 10
  • 38
  • 65
35
votes
4 answers

Make scp always overwrite or create directory

I am using scp to copy a directory from one remote server to a new directory (IE just changing the name) on another remote server like: scp -prq server1:dir1 server2:dir2 This works fine if dir2 does not exist on server2, it creates a new directory…
Giles
  • 351
  • 1
  • 3
  • 4
32
votes
2 answers

SCP transfer only modified files

I'm using below command to transfer files cross server scp -rc blowfish /source/directory/* username@domain.net:/destination/directory Is there a way to transfer only files modified files just like update command for cp?
Passionate Engineer
  • 513
  • 1
  • 6
  • 12
30
votes
3 answers

WinSCP alternative for OS X (that supports sudo and without virtualizing WinSCP)

I recently switched from administering my systems using Windows to OS X. I've found really nice alternatives to damn near everything I used previously, however I have not found a nice GUI editor (sometimes VIM just hurts my face for long scripting…
grufftech
  • 6,620
  • 4
  • 35
  • 37
1
2 3
28 29