9

I download Fedora Cloud Base image for Openstack image from here: https://download.fedoraproject.org/pub/fedora/linux/releases/31/Cloud/x86_64/images/Fedora-Cloud-Base-31-1.9.x86_64.qcow2

Then create a virtual machine on OpenStack based on this image.

In the console of this virtual machine, it shows,

Fedora 31 (Cloud Edition)
Kernel 5.3.7-301.fc31.x86_64 on an x86_64 (tty1)

Localhost login:

My question is, what are the default user account and password here to login?

BTW, I have tried to change the password of root as described in the following link, but it doesn't work. https://forums.fedoraforum.org/showthread.php?297501-How-can-i-change-lost-root-password-in-F20

4 Answers4

6

use guestfs-tools

virt-customize -a Fedora-Cloud-Base-35-1.2.x86_64.qcow2 --root-password password:xyz
Toto
  • 19,304
aks
  • 61
  • 1
  • 2
3

The OpenStack article Get images, has this information:

The simplest way to obtain a virtual machine image that works with OpenStack is to download one that someone else has already created. Most of the images contain the cloud-init package to support the SSH key pair and user data injection. Because many of the images disable SSH password authentication by default, boot the image with an injected key pair. You can SSH into the instance with the private key and default login account. See Configure access and security for instances for more information on how to create and inject key pairs with OpenStack.

It also says:

Note

In a Fedora cloud image, the login account is fedora.

I would try user fedora and password fedora, but if this doesn't work, some images are created so that password login is not possible, and you will need to follow the above link for using a keypair to login.

harrymc
  • 498,455
2

To enable login you can set user-data to:

#cloud-config
password: my_desired_password
chpasswd: { expire: False }
ssh_pwauth: True

Here's what I do to run images locally with KVM/VirtualMachineManager.

# cat meta-data 
instance-id: iid-something-whatwever
local-hostname: desired-hostname

cat user-data

#cloud-config password: my_desired_password chpasswd: { expire: False } ssh_pwauth: True

genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data

Then you use seed.iso as a CDROM. Surely there must be a way to add ssh key with user-data but I haven't investigated that yet.

akostadinov
  • 1,530
0

to add ssh key:

# Create a meta-data file.
cat << 'EOF' | sudo tee ~/meta-data > /dev/null
instance-id: iid-local01
local-hostname: srv-ansible
EOF

Create a user-data file

cat << 'EOF' | sudo tee ~/user-data > /dev/null #cloud-config

system_info: default_user: name: opc

ssh_authorized_keys:

  • <paste_public_key_here>

EOF

Generate an SSH Key Pair (si no existe)

ssh-keygen -t rsa -b 4096

Copy the public key into the user-data file

SSHKEY=$(cat ~/.ssh/id_rsa.pub) sed -i "s|<paste_public_key_here>|${SSHKEY}|g" ~/user-data

Generate the ISO image

genisoimage -output /isos/OL8U10-data.iso -volid cidata -joliet -rock ~/user-data ~/meta-data

Toto
  • 19,304