同步文件从一个EC2实例到另一个 [英] Sync files from one EC2 instance to another

查看:888
本文介绍了同步文件从一个EC2实例到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我会做的rsync,但rsync的通过SSH需要有第二个EC2实例的私钥。我很担心我的复制私有SSH密钥到服务器。这不可能是安全的,对吗?

I was going to do rsync, but rsync over SSH needs to have the private key on the second EC2 instance. I'm concerned about copying my private SSH key to the server. That can't be safe, right?

有另一种可能性,例如,不知何故,通过我的电脑得到验证?如果它只是一个小的auth支票在每个同步开始时,我不介意。

Is there another possibility, e.g. somehow getting authentication via my computer? If it's only a little auth check at the beginning of each sync, I don't mind that.

或者,我可以安全地同步EC2实例之间的文件没有私钥?

Or can I securely sync files between EC2 instances without the private key?

感谢您的输入, MRB

Thanks for your input, MrB

推荐答案

您不必使用EC2键在两个EC2实例之间建立SSH。看看这个导游 - <一个href="http://ask-leo.com/how_can_i_automate_an_sftp_transfer_between_two_servers.html">http://ask-leo.com/how_can_i_automate_an_sftp_transfer_between_two_servers.html 。

You needn't use your EC2 keys to setup SSH between the two EC2 instances. Look at this guide - http://ask-leo.com/how_can_i_automate_an_sftp_transfer_between_two_servers.html .

工艺简单轮廓,可以说你想从Server1上传输文件到Server2。你基本上创建Server1上你的用户一个新的密钥(注意,这是你下载访问您的EC2实例的主要不同 - 在这种情况下,服务器1)。然后加载了公众参与Server2上的authorized_keys中,你应该能够安装SSH。

Simple outline of the process is, lets say you want to transfer files from Server1 to Server2. You basically create a new key for your user on Server1 (note this is different from the key you downloaded to access your EC2 instance - Server1 in this case). Then load up the public part in Server2's authorized_keys and you should be able to setup SSH.

如果该rsync的进程正在运行下的用户是不是你的用户,那么你就必须设置SSH密钥的用户,这一进程将运行下。

If the user that the rsync process is going to run under is not your user, then you will have to setup SSH keys for the user that the process will run under.

心连心

这篇关于同步文件从一个EC2实例到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆