如何在EC2服务器之间同步/ scp文件/文件夹?

问题描述 投票:0回答:1

我尝试在两个EC2服务器之间执行scp / rsync命令,但由于出现快照不足而收到错误。

通常,当我通过PuTTY将ssh connect发送到服务器时,我需要附加一个私钥。因此,我可以猜测的是该命令需要按键。

如何在命令中添加密钥?

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9OY09uQy5wbmcifQ==” alt =“在此处输入图像描述”>

ssh rsync scp private-key
1个回答
2
投票

[man scp将显示选项-i

  -i identity_file
         Selects the file from which the identity (private key) for RSA authentication is read.  This option is directly passed to ssh(1).

由于选项已传递给ssh(如上所述),因此可以传递给rsync-e "ssh -i /path/to/private/key"

© www.soinside.com 2019 - 2024. All rights reserved.