Using SSH for backup
In this example, we make a backup copy of the files in the remote_serious_files folder located on the server and place them in our system as backup.tar.gz: (We enter this command on the server)
#tar -zcvf - /remote_serious_files/ |ssh [email protected] "cat >/root/backup.tar.gz"
Using SSH Tunnel
With the help of SCP, We can transfer files in the SSH tunnel (Secure than first method)
#scp /root/file.deb root@[ServerIPAddress]:/root/file.deb
Transfer file from client to server
Transferring the amir.jpg file from the server to the client:
#scp root@[ServerAddress]:/root/amir.jpg /Users/dearuser/Desktop/
Transfer Directory from client to server
#scp -r /home root@[SeverAddress]:/root/
File transfer from one server to another
#scp root@[SourceServerAddress]:/home/amir.jpg root@[DestinationServerAddress]:/home/
By default, the SCP service uses the 3des protocol for encryption. You can increase the transmission speed by changing this protocol to blowfish
#scp -c blowfish /root/squed.conf root@[DestinationAddress]:/etc/squed3/