Transfer files between 2 Linux servers using scp

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.

  1. First, we must have scp in both machines. Install openssh-clients:

    [bash]yum install openssh-clients[/bash]

  2. Login to the machine which the original file locates
  3. Run the following commands:
    [bash]scp your/local/file/path remote_user@remote_ip_or_domain:/remote/path[/bash]

Leave a comment

Your email address will not be published. Required fields are marked *