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

scp returns "unexpected " error

I am trying to scp a file from a server to my local machine, but it is giving me this error: protocol error: unexpected This is my syntax: scp user@server:/path/to/file . It did not work on this server, but then I tried the same command…
srchulo
  • 306
  • 1
  • 2
  • 10
13
votes
4 answers

Is BitTorrent good for copy files between servers in the workplace?

I have 1 source server that contains about 30GB of files that I want to copy to 7 other servers. I currently SCP the files over to the first four servers and when that transfer is complete SCP to the last 3 servers. Would using BitTorrent be faster…
Edward
  • 449
  • 3
  • 12
13
votes
5 answers

SSH / SCP Server on Windows

Possible Duplicate: What is a good SSH server to use on Windows? Can anyone on the SF community recommend a trustworthy/easy to set up SCP server for windows. I do not want to go through the trouble of setting up Cygwin but I have a need for…
WerkkreW
  • 5,969
  • 3
  • 24
  • 32
12
votes
1 answer

SCP with password authentication only doesn't ask me for password

I'm trying to copy files from one server to another with scp. On both servers, I configured ssh port to 222. sshd_config for both servers is exactly the same (no RootLogin, PasswordAuthentication enabled) For many reasons too long to explain here, I…
Harkonnen
  • 223
  • 1
  • 2
  • 4
12
votes
5 answers

scp - Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

Trying to copy files over from serverB to serverA and get the following error: root@server:~# scp /root/test.txt root@111.111.111.111:/home/somefolder/ Permission denied (publickey,gssapi-keyex,gssapi-with-mic). lost connection On serverA I created…
user756659
  • 273
  • 1
  • 2
  • 10
12
votes
1 answer

Reliable file transfer over slow or flaky network link

I need to transfer a number of files files over a low-quality broadband link to a server. The files are large, and take approximately 30 minutes to transfer per file. I use scp, but it sometimes hangs -- the transfer doesn't fail with an error, it…
user1219721
  • 487
  • 1
  • 6
  • 15
11
votes
4 answers

Delete files older than X days on remote server with SCP/SFTP

Do anyone know some good way to delete files on remote server that are older than X days using just SCP/SFTP? Sure I can write some script on perl etc but I feel it's overkill. Any UNIX way? Oneliner? Separate utility? Thanks P.S. The task is to…
Mike
  • 374
  • 1
  • 3
  • 13
9
votes
2 answers

scp only files with defined extension

I want to transfer only files with special extensions (like only *.tar.gz, *.war) in one scp command (Debian Linux). Is this possible, if yes how is the syntax? Should be someting like: scp 192.168.1.2:/srv/myfiles/'*.tar.gz *.war' . But this is…
markus
  • 1,080
  • 5
  • 18
  • 38
9
votes
4 answers

Use scp to copy a file to different servers

I have to copy a file to different servers almost every day. What I usually do is: scp filename user@destinationhost:/destination/folder I run this same command changing the destination host over and over again until I finish all the servers. What…
Ruben
  • 93
  • 1
  • 1
  • 4
9
votes
3 answers

scp - skip a file while running

I'm running scp and copying a folder from remote server, I'm running with -rl , so i see the files being copy, is it possible to skip current file some way?
Chen Kinnrot
  • 191
  • 1
  • 1
  • 6
9
votes
2 answers

Linux SCP defining destination port

How can I specify a port for the destination ip? When I do scp -p 0000 it still tries to connect on port 22, not the one I'm specifying. scp svn_backup.tgz user@xxx.xxx.xx.xxx:/path/to/new/svn/
Ben
  • 3,800
  • 18
  • 65
  • 96
8
votes
1 answer

bind interface for upload : scp works, not rsync

I need to upload file on a specific interface. This cannot be set-up via iptables, because my script output on several interfaces. this is working fine : scp -oBindAddress=192.168.100.1 ... but rsync --address=192.168.100.1 is still sending on…
user1219721
  • 487
  • 1
  • 6
  • 15
8
votes
8 answers

Copying huge files between two remote machines - Efficiently

I have a shell script which keeps on copying huge files (2 GB to 5 GB) between remote systems. Key based authentication is used with agent-forwarding and everything works. For ex: Say the shell script is running on machine-A and copying files from…
Varun
  • 405
  • 2
  • 4
  • 7
8
votes
4 answers

Why getting a permission denied (public key) error for SCP when SSH works

I'm trying to copy a file from my local host to my Amazon EC2 instance using SCP and receiving the error: Warning: Identity file blocks_key.pem not accessible: No such file or directory. Permission denied (publickey). lost connection The…
John
  • 91
  • 1
  • 1
  • 4
8
votes
2 answers

Does SCP lock the file it is transfering?

Have a situation where we have an application log sitting out on an AIX server. The log is being continually written to from the application, and we have users on Windows who want to view the file. What they've been doing is using WinSCP to…
ThaDon
  • 497
  • 1
  • 5
  • 15
1 2
3
28 29