使用 CloudFormation 自动创建 linux 用户密码
Creating linux user password automatically with CloudFormation
我正在使用 CloudFormation 创建一个 EC2 Linux 机器,我可以通过 RDP 将其连接到其中。我是 运行 所需的安装命令:
"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 用户设置密码。当需要用户输入时,如何自动 return 默认密码值?也许有更好的方法来解决这个问题?
如有任何帮助,我们将不胜感激!
我正在使用 CloudFormation 创建一个 EC2 Linux 机器,我可以通过 RDP 将其连接到其中。我是 运行 所需的安装命令:
"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 用户设置密码。当需要用户输入时,如何自动 return 默认密码值?也许有更好的方法来解决这个问题?
如有任何帮助,我们将不胜感激!