{"id":23232,"date":"2020-12-09T10:15:13","date_gmt":"2020-12-09T02:15:13","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&p=23232"},"modified":"2023-01-18T14:11:55","modified_gmt":"2023-01-18T06:11:55","slug":"how-to-securely-transfer-files-via-rsync-and-ssh-on-linux-2","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/how-to-securely-transfer-files-via-rsync-and-ssh-on-linux-2","title":{"rendered":"Transfer Files via rsync and SSH on Linux"},"content":{"rendered":"\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t

Transfer Files via rsync and SSH on Linux<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

When it comes to transferring files between systems on the network, there are tons of tools available out there for Linux and Unix users.<\/p>

Nowadays, the most popular protocols for data transfer are SSH and FTP. However, while FTP is very popular, we would still recommend you to use SSH. This is because it is the most secure way to transfer your files.<\/p>

There are specialized tools for file transfer over SSH like scp<\/em> and sftp. However,<\/em> none of them has all the features that rsync provides. Furthermore, we can use rsync<\/strong> for <\/strong>mirroring data, incremental backups, copying files between systems<\/strong>, and so on.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t

Before we start, make sure you have the rsync utility installed on both the destination and the source systems. If not, you can install it using your distribution\u2019s package manager:<\/p>

Ubuntu and Debian:<\/strong><\/p>

sudo apt install rsync<\/code><\/pre>

CentOS and Fedora:<\/strong><\/p>

sudo yum install rsync<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

Also, you should also have accessed SSH on your computer.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t

Well, here is how to Securely Transfer Files via rsync.\u00a0<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"rsync\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t

Standard SSH Port:<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

rsync -avHe ssh\u00a0user@server:\/path\/to\/file\u00a0\/home\/user\/path\/to\/file<\/p>