Files can be transferred using ftp server. FTP is most common way to transfer files between servers. But FTP is not secure as it sends username and password using simple text.
Syntex:
scp username@from-server:<path-to-file> username@to-server:<path-to-file>
Where,
username = username of user who has right to access the server
from-server = Server from which file is to be transfered.
path-to-file = is the absolute path of file
to-server = server where file is to be transfered
Examples
1) scp root@server.com:/home/user1/file1.txt file1.txt
here we are copying file1.txt from server.com server and the username of server.com is root
2) scp *.txt root@server.com:/home/user1
here we are copying all text files in current directory to server.com's /home/user1 directory
3) scp -r root@server1.com:/home/user1 root@server2.com:/home/user1
here we are copying all file recursively from server1.com's /home/user1 to server2.com's /home/user1
Requirements: -
open-ssh