Dcp (Dat Copy) – Easy and secure way to transfer files between Linux systems

Linux has native command to perform this task nicely using scp and rsync. However, we need to try new things.Also, we need to encourage the developers who is working new things with different concept and new technology.

We also written few articles similar to this topic, you can navigate those by clicking the below appropriate links.

Those are OnionShare, Magic Wormhole, Transfer.sh and ffsend.

What is Dcp?

dcp copies files between hosts on a network using the peer-to-peer Dat network.

dcp can be seen as an alternative to tools like scp, removing the need to configure SSH access between hosts.

This lets you transfer files between two remote hosts, without worrying about the specifics of how the hosts reach each other and regardless of whether hosts are behind NATs.

dcp requires zero configuration and is secure, fast, and peer-to-peer. Also, this is not production-ready software. Use at your own risk.

What is Dat Protocol?

Dat is a peer-to-peer protocol. A community-driven project powering a next-generation Web.

How dcp works:

dcp will create a dat archive for a specified set of files or directories and, using the generated public key, lets you download said archive from a second host.

Any data shared over the network is encrypted using the public key of the archive, meaning data access is limited to those who have access to said key.

dcp Use cases:

  • Send files to multiple colleagues – just send the generated public key via chat and they can receive the files on their machine.
  • Sync files between two physical computers on your local network, without needing to set up SSH access.
  • Easily send files to a friend without needing to create a zip and upload it the cloud.
  • Copy files to a remote server when you have shell access but not SSH, for example on a kubernetes pod.
  • Share files between Linux/macOS and Windows, which isn’t exactly known for great SSH support.

How to Install NodeJS & npm in Linux?

dcp package was written in JavaScript programming language so, we need to install NodeJS as a prerequisites to install dcp. Use the following command to install NodeJS in Linux.

For Fedora system, use DNF Command to install NodeJS & npm.

$ sudo dnf install nodejs npm

For Debian/Ubuntu systems, use APT-GET Command or APT Command to install NodeJS & npm.

$ sudo apt install nodejs npm

For Arch Linux based systems, use Pacman Command to install NodeJS & npm.

$ sudo pacman -S nodejs npm

For RHEL/CentOS systems, use YUM Command to install NodeJS & npm.

$ sudo yum install epel-release
$ sudo yum install nodejs npm

For openSUSE Leap system, use Zypper Command to install NodeJS & npm.

$ sudo zypper nodejs6

How to install dcp in Linux?

Once you have installed the NodeJS, use the following npm command to install dcp.

npm is a package manager for the JavaScript programming language. It is the default package manager for the JavaScript runtime environment Node.js.

# npm i -g dat-cp

How to Send Files Through dcp?

Enter the files or folders which you want to transfer to remote server followed by the dcp command, And no need to mention the destination machine name.

# dcp [File Name Which You Want To Transfer]

It will generate a dat archive for the given file when you ran the dcp command. Once it’s done then it will generate a public key at the bottom of the page.

How to receive files through dcp?

Enter the generated public key on remote server to receive the files or folders.

# dcp [Public Key]

To recursively copy directories.

# dcp [Folder Name Which You Want To Transfer] -r

In the following example, we are going to transfer a single file.

Output for the above file transfer.

If you want to send more than one file, use the following format.

Output for the above file transfer.

To recursively copy directories.

Output for the above folder transfer.

It won’t allow you to download the files or folders second time. It means once you downloaded the files or folders then immediately the link will be expired.

Navigate to man page to know about other options.

# dcp --help

About Vinoth Kumar

Vinoth Kumar has 3.5+ years of experience in Linux server administration & RHEL certified professional. He is currently working as a Senior L2 Linux Server administrator.

View all posts by Vinoth Kumar

Leave a Reply

Your email address will not be published. Required fields are marked *