reinstall/cloud-init.yaml
bin456789 58ff5f69f2
core: 云镜像禁用 NoCloud 数据源
能防止 cloud-init 使用 sr0 的配置文件
2023-11-12 17:29:15 +08:00

26 lines
840 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#cloud-config
datasource_list: [None]
timezone: Asia/Shanghai
disable_root: false
ssh_pwauth: true
users:
- name: root
lock_passwd: false
chpasswd:
expire: false
# 20.04 arm 需要
list: |
root:123@@@
users:
- name: root
password: 123@@@
type: text
runcmd:
# arch 没有 /etc/ssh/sshd_config.d/ 文件夹
# opensuse tumbleweed 有 /etc/ssh/sshd_config.d/ 文件夹,但没有 /etc/ssh/sshd_config但有/usr/etc/ssh/sshd_config
- grep 'Include.*/etc/ssh/sshd_config.d' /etc/sshd_config && echo "PermitRootLogin yes" >/etc/ssh/sshd_config.d/01-permitrootlogin.conf || echo "PermitRootLogin yes" >>/etc/ssh/sshd_config
- systemctl restart sshd
- touch /etc/cloud/cloud-init.disabled
# ubuntu 镜像运行 echo -e '\nDone' -e 会被显示出来
- printf '\n%s\n' 'done' >/dev/tty0 || true