Linux server1 send file to Linux server2


需求

Linux服务器1 发文件到Linux 服务器2

step1. Linux server1 generate a pair of key and provide public key with Linux server2

ssh-keygen -b 2048 -t rsa -C "@"

step2. Linux server2 provide below informationask with Linux server1

  1. FQDN
  2. Port
  3. SFTP profile
  4. File path to receive the file

step3. Linux server2 import public key

  1. Upload the key file to your sftp profile path, such as /home/users/wasadm/.ssh
  2. Append public key content to authorized_keys file, such as using command 
    cat  >> authorized_keys
    

step4. connectivity test

  • Linux server1 connect to Linux server2 with private key:   
    sftp -i  remoteUser@remoteServer
    
  • Linux server1 send file to Linux server2 with private key:  
    scp -i  -P 22  remoteUser@remoteServer: