Linux server1 send file to Linux server2

Posted dream_heheda

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 server

ssh-keygen -b 2048 -t rsa -C "<Linux server1 user>@<key name>"

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 <key name> >> authorized_keys

step4. connectivity test

  • Linux server1 connect to Linux server2 with private key:   
sftp -i <private key> remoteUser@remoteServer

  

  • Linux server1 send file to Linux server2 with private key:  
scp -i <private key> -P 22 <test.txt> remoteUser@remoteServer:<destination path in Linux server2>

以上是关于Linux server1 send file to Linux server2的主要内容,如果未能解决你的问题,请参考以下文章

Linux server1 send file to Linux server2

send_file 用于 Sinatra 中的临时文件

Linux虚拟机之间实现密钥登陆

linux bind,如何配置能够解析不带域名的host主机名。

什么是 XMLHttpRequest.send(file) 的 Fetch API 等价物?

Flask send_file request