【发布时间】:2021-03-18 23:58:01
【问题描述】:
我正在使用 CloudFormation 创建可以 RDP 进入的 EC2 Linux 机器。我正在运行所需的安装命令:
"Metadata" : {
"AWS::CloudFormation::Init" : {
"config" : {
"commands" : {
"step_a" : {
"command" : "install some stuff..."
},
"step_g" : {
"command" : "sudo yum groupinstall \"Gnome Desktop\" -y"
},
"step_h" : {
"command" : "sudo passwd centos"
},
"step_i" : {
"command" : "configure firewall to allow rdp..."
}
}
}
}
}
正如你所见,在 step_h 中,我想为默认的 centos 用户设置密码。当需要用户输入时,如何自动返回默认密码值?也许有更好的方法来解决这个问题?
任何帮助将不胜感激!
【问题讨论】:
标签: linux amazon-web-services amazon-ec2 command-line-interface amazon-cloudformation