mirror of
https://github.com/bin456789/reinstall.git
synced 2026-02-04 09:04:18 +08:00
core: 放置 cloud-init 配置时,删除注释
This commit is contained in:
25
cloud-init.yaml
Normal file
25
cloud-init.yaml
Normal file
@ -0,0 +1,25 @@
|
||||
#cloud-config
|
||||
datasource_list: [NoCloud]
|
||||
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/console
|
||||
Reference in New Issue
Block a user