Remote file transfer with SCP and RSYNC
SCP (SECURE COPY)
scp stands for secure cp (copy), which means that you can copy files across an ssh connection that will be encrypted, and therefore secured. As scp will be using ssh protocol to transfer the data, hence it is termed as the safest method of transferring data from one location to another.
To copy a file using SCP to remote machine from source location
The syntax for SCP a file from source location.
#scp file name remote hosts IP:/location to copy the file
#scp /file1 192.168.10.95:/root/
To copy a file using SCP from a remote machine being in destination’s location
Let’s reverse the previous task,
The syntax for SCP a file from destination location.
#scp source system’s IPх:/location of file to be copiedх destination location to copyх
To copy a directory using SCP to remote machine from source’s location
The syntax SCP a directory from source’s location, the syntax is
#scp option dir name remote hosts IP:/location to copy the directory
#scp -r /dir1 192.168.10.95:/root/
To copy a directory using SCP from a remote machine being in destination’s location
The syntax for SCP a file from destination location.
#scp option source system’s IPх:/location of file to be copiedх destination location to copy
#scp -r 192.168.10.98:/dir1 /root/
RSYNC (REMOTE SYNCHRONIZATION)
rsync is a very good program for backing up/mirroring a directory tree of files from one machine to another machine, and for keeping the two machines "in sync." It's designed to speed up file transfer by copying the differences between two files rather than copying an entire file every time.
rsync is used it will only copy the updated files/directories rather than copying all files/directories inside main directory, which saves lots of time and speedup the transfer
If rsync is combined with ssh it makes a great utility to sync the data securely. If rsync is not used
with ssh, the risk sniffing will always be there
The syntax to rsync a directory is
#rsync options encryption source dir destination IP:/location of destination dir
#rsync -rv -e ssh /test 192.168.10.95:/root/
Смотрите видео what is the difference between scp and rsync in linux? | scp | rsync | ssh | RHEL | linux онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Red hat Linux Training for beginners 15 Июль 2020. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 1,887 раз и оно понравилось 21 посетителям.