【问题标题】:How to copy files into different directory in a remote machine [closed]如何将文件复制到远程机器的不同目录中[关闭]
【发布时间】:2017-02-22 08:50:59
【问题描述】:

如何将文件复制到远程机器的不同目录中?

例如:

  • 我的服务器:10.10.0.1
  • 远程服务器:10.10.0.2

我必须登录到 10.10.0.1(通过 Putty)。从这里,我必须将远程机器中的文件从/home/test/myFile.txt 复制到/home/bkp/myFile.txt

源文件夹和目标文件夹都在远程计算机中。

【问题讨论】:

    标签: bash unix ssh scp


    【解决方案1】:

    假设您可以ssh 到 10.10.22.12 作为“用户名”并且“用户名”对 /home/testBkp 具有写入权限:

    scp /home/test/sample.txt username@10.10.22.12:/home/testBkp/sample.txt
    

    【讨论】:

      【解决方案2】:

      使用 scp。例如:

      scp file_to_copy user@server:/home/user/foldername/filename.ext
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2010-09-09
        • 2015-05-06
        • 2016-09-27
        • 1970-01-01
        • 2019-10-07
        • 1970-01-01
        • 2015-03-05
        相关资源
        最近更新 更多