mirror of
https://github.com/bin456789/reinstall.git
synced 2026-02-04 09:04:18 +08:00
redhat: 支持安装 oracle linux
This commit is contained in:
@ -16,8 +16,11 @@ chpasswd:
|
||||
password: 123@@@
|
||||
type: text
|
||||
runcmd:
|
||||
# opensuse tumbleweed 有 /etc/ssh/sshd_config.d/ 文件夹,没有 /etc/ssh/sshd_config,有/usr/etc/ssh/sshd_config
|
||||
- grep 'Include.*/etc/ssh/sshd_config.d' /etc/ssh/sshd_config && mkdir -p /etc/ssh/sshd_config.d && echo "PermitRootLogin yes" >/etc/ssh/sshd_config.d/01-permitrootlogin.conf || echo "PermitRootLogin yes" >>/etc/ssh/sshd_config
|
||||
# opensuse tumbleweed 镜像有 /etc/ssh/sshd_config.d/ 文件夹,没有 /etc/ssh/sshd_config,有/usr/etc/ssh/sshd_config
|
||||
# opensuse tumbleweed cloud-init 直接创建并写入 /etc/ssh/sshd_config,造成默认配置丢失
|
||||
# 下面这行删除 clout-init 创建的 sshd_config
|
||||
- test $(wc -l </etc/ssh/sshd_config) -le 1 && cat /etc/ssh/sshd_config >>/etc/ssh/sshd_config.d/50-cloud-init.conf && rm -f /etc/ssh/sshd_config
|
||||
- echo "PermitRootLogin yes" >/etc/ssh/sshd_config.d/01-permitrootlogin.conf || sed -Ei 's/^#?PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||
- systemctl restart sshd || systemctl restart ssh
|
||||
- touch /etc/cloud/cloud-init.disabled
|
||||
# ubuntu 镜像运行 echo -e '\nDone' ,-e 会被显示出来
|
||||
|
||||
Reference in New Issue
Block a user