#cloud-config

# 设置主机名
hostname: {{.Hostname}}

password: {{.InitPassword}}

disable_root: false
disable_root_opts: ""
ssh_pwauth: true

chpasswd:
  expire: false
runcmd:
  - echo 'root:{{.InitPassword}}' | chpasswd
  - echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
  - echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
  - systemctl restart sshd
  - echo {{.MachineId}} > /etc/machine-id
