It is easy to upload file from your local machine to a remote machine via popular file transfer protocols such as ftp, sftp, but how to transfer files between 2 Linux servers with command lines? This article will mention about this need by using scp.
- First, we must have scp in both machines. Install openssh-clients:
[bash]yum install openssh-clients[/bash]
- Login to the machine which the original file locates
- Run the following commands:
[bash]scp your/local/file/path remote_user@remote_ip_or_domain:/remote/path[/bash]