![打包程序将私钥存储在哪里?](https://linux22.com/image/1612337/%E6%89%93%E5%8C%85%E7%A8%8B%E5%BA%8F%E5%B0%86%E7%A7%81%E9%92%A5%E5%AD%98%E5%82%A8%E5%9C%A8%E5%93%AA%E9%87%8C%EF%BC%9F.png)
我从 ubuntu shell 运行以下命令,与 AWS 平台通信:
$ packer build -debug template.packer
Debug mode enabled. Builds will not be parallelized.
amazon-ebs output will be in this color.
==> amazon-ebs: Prevalidating AMI Name...
==> amazon-ebs: Pausing after run of step 'StepPreValidate'. Press enter to continue.
==> amazon-ebs: Inspecting the source AMI...
==> amazon-ebs: Pausing after run of step 'StepSourceAMIInfo'. Press enter to continue.
==> amazon-ebs: Creating temporary keypair: packer 5dfe9f3b-9cc2-cbfa-7349-5c8ef50c64d5
amazon-ebs: Saving key for debug purposes: ec2_amazon-ebs.pem
==> amazon-ebs: Pausing after run of step 'StepKeyPair'. Press enter to continue.
哪里template.packer
:
{
"builders": [
{
"type": "amazon-ebs",
"region": "us-west-2",
"source_ami": "ami-9abea4fb",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "MiddleTier-{{isotime | clean_ami_name}}",
"ami_description": "Amazon AMI customised",
"tags": {
"role": "MiddleTier"
},
"run_tags":{
"role": "buildSystem"
}
}
],
"provisioners": [
],
"post-processors":[
]
}
我的理解是,AWS 已经为打包程序创建了一个私钥(ec2_amazon-ebs.pem
),以便以无密码方式与 EC2 实例通信,如上述步骤中所述。
但我没有看到打包程序在我的笔记本电脑中复制私钥ec2_amazon-ebs.pem
(因为~/.ssh/ec2_amazon-ebs.pem
)
打包程序如何与 EC2 通信?无需像~/.ssh/ec2_amazon-ebs.pem
在笔记本电脑中那样进行复制