Update rebuild_qcow2.sh

This commit is contained in:
spiritlhl 2023-08-01 23:39:37 +08:00 committed by GitHub
parent 67c69ed41d
commit 4b16fa3e0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@ elif [[ "$qcow_file" == *"alpine"* ]]; then
echo "启用root登录..."
virt-customize -a $qcow_file --edit '/etc/cloud/cloud.cfg:s/preserve_hostname: *false/preserve_hostname: true/'
virt-customize -a $qcow_file --edit '/etc/cloud/cloud.cfg:s/disable_root: *true/disable_root: false/'
virt-customize -a $qcow_file --edit '/etc/ssh/sshd_config:s/^#\?PasswordAuthentication.*/PasswordAuthentication yes/'
virt-customize -a $qcow_file --edit '/etc/ssh/sshd_config:s/PasswordAuthentication no/PasswordAuthentication yes/'
virt-customize -a $qcow_file --edit '/etc/ssh/sshd_config:s/^#?\(Port\).*/\1 22/'
virt-customize -a $qcow_file --edit '/etc/ssh/sshd_config:s/^#PermitRootLogin\|PermitRootLogin/c PermitRootLogin yes/'
virt-customize -a $qcow_file --edit '/etc/ssh/sshd_config:s/^#AddressFamily\|AddressFamily/c AddressFamily any/'