#cloud-config
# from 1 files
# default-cloud-config.yaml
---
chpasswd:
expire: false
users:
- name: root
password: $2y$10$yi6mRCLMrlheMAOv5pzUvOHBLYhRkKZ.FeAJpsfpPfqcHa1XOXyAW
type: hash
disable_root: false
runcmd:
- grep -q "^PermitRootLogin" /etc/ssh/sshd_config && sed -i 's/^PermitRootLogin.*$/PermitRootLogin
yes/' /etc/ssh/sshd_config || echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
&& echo "" >> /etc/ssh/sshd_config
- systemctl restart ssh.service || systemctl restart sshd.service
ssh_pwauth: true
...