Amazon web services 如何从控制台重新运行aws ec2上的用户数据?
我想问一下,是否有办法在已启动的实例上重新执行用户数据。 我想重新启动服务并编辑~./ssh/autorized_密钥 我在Amazon web services 如何从控制台重新运行aws ec2上的用户数据?,amazon-web-services,amazon-ec2,user-data,cloud-init,Amazon Web Services,Amazon Ec2,User Data,Cloud Init,我想问一下,是否有办法在已启动的实例上重新执行用户数据。 我想重新启动服务并编辑~./ssh/autorized_密钥 我在 但是控制台的云日志没有显示任何更改。AWS仅在第一次启动时运行用户数据。您需要做以下两件事: 使用mime multipart附加新脚本。您可以在cloud utils中使用命令write mime multipart来创建mime multipart文件。如果您需要更多详细信息,请参阅 使用mime multipart设置脚本用户始终运行。在/etc/cloud/clo
但是控制台的云日志没有显示任何更改。AWS仅在第一次启动时运行用户数据。您需要做以下两件事:
cloud utils
中使用命令write mime multipart
来创建mime multipart文件。如果您需要更多详细信息,请参阅脚本用户
始终运行。在/etc/cloud/cloud.cfg
中,请参阅查看选项
Content-Type: multipart/mixed; boundary="===============5940869395195845375=="
MIME-Version: 1.0
--===============5940869395195845375==
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloud-config.txt"
#cloud-config
cloud_final_modules:
- [scripts-user, always]
--===============5940869395195845375==
Content-Type: text/x-shellscript; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="userdata.txt"
#!/bin/bash
/bin/echo "Hello World." >> /tmp/abcde
--===============5940869395195845375==