How to create windows image in packer using the keypair

夙愿已清 提交于 2019-12-12 01:46:42

问题


I am creating the windows image with username and password using packer. It is working fine. I can able to create image.

My requirement is i need to create the windows image with key pair using packer. I have searched a lot but not found any document to create windows image with key pair.

Please let me know how to do this using packer.


回答1:


It's hard to understand your exact question but I'll make a guess.

You want to build a Windows AMI which when launched sets a random Administrator password which is encrypted with the keypair.

This is how Packer will work if don't specify any winrm_password, and if you don't specify any ssh_keypair_name and no ssh_private_key_file Packer will create a temporary keypair.

If you want to use a existing keypair just define ssh_keypair_name and ssh_private_key_file.

The random Administrator password will be set by the instance when launching the first time and will be encrypted with the public key from the keypair. To get the password you need to decrypt it with the corresponding private ssh key. See AWS CLI - get password data and EC2 - Windows Passwords



来源:https://stackoverflow.com/questions/42138964/how-to-create-windows-image-in-packer-using-the-keypair

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!