Back to Blog March 01, 2024 41 READS

Enabling SSH Root Login on CentOS QCOW2 Images via Guestfish

Enabling SSH Root Login on CentOS QCOW2 Images via Guestfish

Guestfish is a powerful tool that allows us to manipulate disk images directly without starting the VM. Here is how to configure SSH Root login:

guestfish --rw -a CentOS-7.qcow2
> run
> mount /dev/sda1 /
> vi /etc/cloud/cloud.cfg

In cloud.cfg, modify the following lines: disable_root: 0 and ssh_pwauth: 1. This method is highly efficient for pre-configuring cloud images.

Share this with