from a trivial portscan) to inject arbitrary data into the stream thereby corrupting your dd operation. VPN).įurther on the subject of the warning above: Because netcat does not use any sort of authentication mechanism, it is possible for someone who knows your netcat port (e.g. We strongly recommend against using this method for WAN data transfers, unless you are doing so over an encrypted tunnel (e.g. If using the netcat method, take a moment to consider the implications of sending raw, unecrypted data over your network. Netcat opens an encryption-less connection from one host to another, which is why it outperforms SSH.
I will get into the details of how to perform a transfer akin to the one referenced above, however let's first take a look at some of the speed comparisons of dd over netcat vs dd over SSH. Netcat (or nc on some systems) is a handy utility for setting up quick and dirty TCP or UDP sockets for the transmission of, well really anything. for internal network transfers), then there is another option. When data encryption is not a concern (i.e. The problem, however, is that because of this encryption SSH has a lot of overhead which sacrifices transfer speed. This method generally suffices for fast speed transfers and smaller amounts of data, and also has the advantage of using SSH's built in encryption for secure transfers. This would make an exact copy of the local /dev/sda device on /dev/sdb attached to. One traditional way to get this drive data from one location to another is to pipe DD's output stream over SSH to a shell on a remote machine which in turn uses dd to pipe it to a given output file/device. Since it can read directly from raw device files, it is very useful for copying entire partitions or drives from one location to another. Dd is a very handy shell command for writing raw data blocks from one place to another.