From e8cfa668c64e1b188bce0c59c77920dd55c6450c Mon Sep 17 00:00:00 2001 From: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:15:18 +0800 Subject: [PATCH] Update rebuild_qcow2.sh --- back/rebuild_qcow2.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/back/rebuild_qcow2.sh b/back/rebuild_qcow2.sh index 9f38ec0..c9284b0 100644 --- a/back/rebuild_qcow2.sh +++ b/back/rebuild_qcow2.sh @@ -25,6 +25,8 @@ virt-customize -a $qcow_file --run-command "echo '--by https://t.me/spiritlhl' > echo "启用SSH功能..." virt-customize -a $qcow_file --run-command "systemctl enable ssh" virt-customize -a $qcow_file --run-command "systemctl start ssh" +virt-customize -a $qcow_file --run-command "systemctl enable sshd" +virt-customize -a $qcow_file --run-command "systemctl start sshd" echo "启用root登录..." virt-customize -a $qcow_file --run-command "sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config" virt-customize -a $qcow_file --run-command "sed -i 's/#PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config" @@ -34,7 +36,9 @@ virt-customize -a $qcow_file --run-command "sed -i 's/#AddressFamily any/Address virt-customize -a $qcow_file --run-command "sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g' /etc/ssh/sshd_config" virt-customize -a $qcow_file --run-command "sed -i 's/#ListenAddress ::/ListenAddress ::/g' /etc/ssh/sshd_config" virt-customize -a $qcow_file --run-command "service ssh restart" +virt-customize -a $qcow_file --run-command "service sshd restart" virt-customize -a $qcow_file --run-command "systemctl restart sshd" +virt-customize -a $qcow_file --run-command "systemctl restart ssh" echo "创建备份..." cp $qcow_file ${qcow_file}.bak echo "复制新文件..."