cloud-init how to add default user to sudoers.d

廉价感情. 提交于 2019-12-04 11:59:29

You need to change the default user in system, see configuration below.

#cloud-config
system_info:
  default_user:
    name: my-user
    sudo: ALL=(ALL) NOPASSWD:ALL

I verified in openstack environment (should be the same)

  • ssh use my-user as default user with default private key
  • sudo is also ok

See http://cloudinit.readthedocs.org/en/latest/topics/examples.html#including-users-and-groups for more detail

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