scp works well in all cases, but the Raspberry Pi is to weak to copy files efficiently in a secure environment (lan). The theoretically possible 6,75 MB/s via 54 Mbit wireless lan shrink down to about 1.1 MB/s.

Is there a way to copy files remotely without encryption?

It should be a cli command with no dependencies to extra services (ftp, samba) or at least with a minimum of configuration. I mean, a standard tool that works quite well out-of-the-box with standard programms/services (like scp/ssh).

  • 2
    "without any dependencies" is virtually not possible. you will always need a program that "listens" on one side (like the ssh/sftp server when using scp) – umläute Feb 3 '14 at 12:00
  • 2
    What about netcat? – yegorich Feb 3 '14 at 12:01
  • Okay you're right. I will change the requirements – ManuelSchneid3r Feb 3 '14 at 12:01
up vote 13 down vote accepted

You might be looking for rcp, it performs remote execution via rsh so you will have to rely on that and have in mind that all communication are insecure.

You cannot disable encryption completely on ssh/scp but you can force it to use a weaker cipher that is much less cpu intensive. Make sure that compression is not turned on in your ssh_config or on the command line and add -c arcfour,blowfish-cbc to your scp command line to select weaker ciphers.

  • 1
    This is a nice idea. Is this possible for host specific config? (.ssh/config) – ManuelSchneid3r Feb 3 '14 at 17:27
  • 3
    @ManuelSchneid3r: Yes: under a Host section in your ssh_config, use Ciphers arcfour,blowfish-cbc to mirror the above -c switch. However, if your CPUs support the AES-NI instruction set, I'd try switching to aes128-gcm@openssh.com (yes, that's the cipher name, including the @ stuff), which will use the blazingly fast (with AES-NI) AES128-GCM. – Reid Feb 3 '14 at 17:51
  • I wouldn't really call blowfish a weak cipher an in general case (i.e. not R-Pi) AEs might be boosted by hw acceleration. – peterph Oct 21 '14 at 21:22

I wrote this quick script:

#!/bin/bash

ssh "$1" "nc -l 2020 > \"$2\" &"
pv "$2" | nc "$1" 2020

It takes two args, the host to send it to and the file you are sending. It only works for one file. It uses ssh to start a netcat listening on the opposite end and then uses netcat to send it to that listening port. I added pv to the start to give a nice progress bar. Replace pv with cat if you don't have or want that. Change the 2020 port to whatever you like. This requires you to have ssh access to the remote system.

This is completely insecure, but then, that's what you wanted.

I think NFS is quite underrated for this sort of task, where you want convenience, speed and don't care about security. NFS is really simple to set up, especially on the client: see this short guide for ubuntu, together with this longer ubuntu community help page. From the client's perspective you just mount the server directory and it looks just like a local drive and you can use cp or rsync or whatever commands you want.

There are patches for openssh for HPC (High Performance Computing) that improve ssh throughput by increasing transfer window sizes and disabling encryption - if you don't mind recompiling (and probably forward-porting patches), check HPN-SSH. As BowlOfRed noticed in the comment, you'd need to use the patches on both the client and the server.

You can also use rsync - on one machine as a daemon and as a simple client on the other one. It is particularly useful for synchronising larger volumes over network link that is slower than reading (and checksumming) the files, since it is able to transfer just those parts of files that differ between client and server. See rsync(1) and rsyncd.conf(5) man pages for details.

  • 2
    This was not explicit in your answer, but these patches include the ability to use the "none" cipher in SSH (in other words, disable encryption entirely). The drawback is that you have to apply and run it on both ends. A normal server won't accept the "none" cipher. – BowlOfRed Oct 21 '14 at 23:06
  • Very good point! – peterph Oct 22 '14 at 8:48

The above bash script by Ben Collins is a good solution, but he is missing the -p flag for the port on the server side. Running that as is would just give you an empty file or a hung server that never does anything.

It's easier to see what this is doing if you just look at the commands.

DestinationShell# nc -l -p 2020 > file.txt

SourceShell# cat file.txt | nc dest.ip.address 2020

nc, or netcat, is just like cat except for the output is echoed into another machine through a TCP connection. You're just pushing the output of nc on the server into the destination file. You can setup the Destination in the same way and do echo foo | nc dest.ip.address 2020 and do all sorts of other things with nc.

it has been some time since the last update, some ciphers have changed, and at least on freeBSD, the blowfish is no longer available. The fastest cipher I found with current ssh installations is -c aes128-cbc.

Enjoy.

If you want to transfer entire file structures use tar.

in the receiving system:

[]# nc -l 2020 | tar xvf -

then on the sending system:

[]# tar cvf - | nc dst.hostname.net 2020

Watch the the files archive on one system and extract on the other ;)

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.