简体   繁体   English

从ec2实例到另一个ec2实例运行Fabric

[英]Running Fabric from an ec2 instance, to another ec2 instance

I'm running Python scripts using Fabric on an ec2 instance. 我在ec2实例上使用Fabric运行Python脚本。 To do so, the scripts and the .pem file are stored and run from my local computer. 为此,脚本和.pem文件是从本地计算机存储并运行的。

Let's say I would like to run these scripts not from my supposedly secure local computer, but from another ec2 instance. 假设我不是想从我本应安全的本地计算机上运行这些脚本,而是想从另一个ec2实例中运行这些脚本。 In order for this second ec2 instance to run scripts on the first instance, and on behalf of the first instance's user, the .pem file should be stored on this second instance. 为了使第二个ec2实例在第一个实例上并代表第一个实例的用户运行脚本,.pem文件应存储在该第二个实例上。 Otherwise, the Fabric connection would prompt for the first instance user's password. 否则,Fabric连接将提示您输入第一个实例用户的密码。

Is there a way to do so without storing the .pem file on a remote instance, since this wouldn't be a recommended security practice ? 有没有一种方法可以不将.pem文件存储在远程实例上,因为这不是推荐的安全做法? (The IAM role ec2 permissions don't seem to help to connect as an ec2 user) (IAM角色ec2权限似乎对以ec2用户身份连接没有帮助)

回答自己...在两个带有Fabric的ec2实例之间使用ssh密钥(而不是pem文件)没有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM