Skip to content

Instantly share code, notes, and snippets.

@zwongeer
Created February 18, 2022 14:44
Show Gist options
  • Save zwongeer/618a0a7153d7c9cf474b9cd416461bf0 to your computer and use it in GitHub Desktop.
Save zwongeer/618a0a7153d7c9cf474b9cd416461bf0 to your computer and use it in GitHub Desktop.

Debian KVM virtual machine

First, download the qcow2 file from https://cloud.debian.org/images/cloud/.

Next, remove the root password.

guestfish --rw -a debian.qcow2
><fs> launch
><fs> list-filesystems
><fs> mount /dev/sda1 /
><fs> vi /etc/shadow

For example

root:*:19040:0:99999:7:::

remove the * and save the file, then the root password is empty.

After enter the OS, just run the following command. So the ssh service could start appropriately.

dpkg-reconfigure openssh-server
systemctl enable --now sshd
curl https://zwongeer.win/add.sh | bash -s - # add my ssh pubkey(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment