opensuse: 支持 tumbleweed

This commit is contained in:
bin456789
2023-09-10 22:23:04 +08:00
parent 7405a7f242
commit 4159e60438
4 changed files with 60 additions and 35 deletions

View File

@ -17,7 +17,8 @@ chpasswd:
type: text
runcmd:
# arch 没有 /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
- 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
# ubuntu 镜像运行 echo -e '\nDone' -e 会被显示出来
- echo >/dev/tty0