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.
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?
Fedora system, use DNF Command to install NodeJS & npm.
$ sudo dnf install nodejs npm
$ sudo apt install nodejs npm
Arch Linux based systems, use Pacman Command to install NodeJS & npm.
$ sudo pacman -S nodejs npm
RHEL/CentOS systems, use YUM Command to install NodeJS & npm.
$ sudo yum install epel-release $ sudo yum install nodejs npm
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 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
Navigate to man page to know about other options.
# dcp --help