创建和使用python博托下载AWS EC2密钥对密钥、python、AWS

由网友(不敢直视我双眼的你)分享简介:我有困难,找出办法(如果可能的话)来创建一个新的密钥对AWS使用了Python的Boto库,然后下载该密钥对。I'm having difficulty figuring out a way (if possible) to create a new AWS keypair with the Python Boto...

我有困难,找出办法(如果可能的话)来创建一个新的密钥对AWS使用了Python的Boto库,然后下载该密钥对。

I'm having difficulty figuring out a way (if possible) to create a new AWS keypair with the Python Boto library and then download that keypair.

推荐答案

由create_keypair方法博托返回的主要对象有一个保存的方法。所以,基本上你可以做这样的事情:

The Key object returned by the create_keypair method in boto has a "save" method. So, basically you can do something like this:

>>> import boto
>>> ec2 = boto.connect_ec2()
>>> key = ec2.create_key_pair('mynewkey')
>>> key.save('/path/to/keypair/dir')

如果你想有一个更详细的例子,请查看的https:// github上。 COM / garnaat /爪/ BLOB /主/ ec2_launch_instance.py 。

If you want a more detailed example, check out https://github.com/garnaat/paws/blob/master/ec2_launch_instance.py.

帮助吗?如果没有,请提供您所遇到的问题的一些具体细节。

Does that help? If not, provide some specifics about the problems you are encountering.

阅读全文

相关推荐

最新文章