Ask Your Question
1

how can i get username and password of a qcow2 image.

asked 2014-09-10 08:01:31 -0500

Dheeraj gravatar image

updated 2014-09-10 08:02:02 -0500

i am download the centos qcow2 file from this link https://openstack.redhat.com/Image_resources

and i lunch my instance and it's console show proper boot but i don't have the user name or password for login into OS.

how can i get user name or password for login into that instance or any one suggest me solution about this.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2014-09-10 12:49:36 -0500

scottnc gravatar image

updated 2014-09-10 12:53:12 -0500

mpetason gravatar image

As Bill mentioned, the various "cloud" guest images are typically set up without any root ssh/password login ability. The idea is that once the image has been deployed in the OpenStack environment, you'd use the associated key pair to ssh into the running instance.

But it's possible to configure the guest image to allow root login with a regular password, if you need to... for a test environment for example.

The basic process is to an offline image configuration tool like guestfish to modify the security config before you import the guest image into OpenStack.

On a RHEL/KVM server you can:

Generate an encrypted password:

openssl passwd -1 new_password

Use guestfish to edit /etc/shadow inside the rhel-7-guest image:

guestfish -a rhel-7-server-guest-image.qcow2
><fs> run
><fs> list-filesystems
><fs> mount /dev/sda1 /
><fs> vi /etc/shadow

Replace the root encrypted password in /etc/shadow with the new one you just generated.

Edit the /etc/ssh/sshd_config file and uncomment the following line:

PermitRootLogin Yes

Now you can quit guestfish

><fs> quit

You should now be able to import the the guest image into OpenStack and once deployed, login as root using the password you set above, in addition to the normal mechanism using the OpenStack key pair. Keep in mind the files and paths may vary a bit for other distros.

edit flag offensive delete link more

Comments

It's work for me. Thank you 'scottnc'

Anario gravatar imageAnario ( 2015-08-22 15:18:03 -0500 )edit

Please, I have the same problem. How did you edit the password? i use vi /etc/shadow but it does not give me the ability to edit the password

aisskar gravatar imageaisskar ( 2015-09-04 11:05:55 -0500 )edit

you would have the '!!' characters for the root entry. replace the '!!' with the funny characters (MD5) openssl has generated and save the file. root:!!:16650:0:99999:7::: to root:$6$w2JQNMnhg$:16650:0:99999:7:::

dashout gravatar imagedashout ( 2015-09-07 01:08:24 -0500 )edit
1

answered 2014-09-10 09:02:31 -0500

SGPJ gravatar image

updated 2014-09-10 10:10:38 -0500

You need to ssh into the VM using keypair. Generate keypair and ssh into it using private key :

ssh -i test.pem  centos@x.x.x.x

Refer similar usage: https://ask.openstack.org/en/question...

edit flag offensive delete link more

Comments

There typically are no passwords for cloud images, once you ssh in as described above you then setup you security.

Bill@Metacloud gravatar imageBill@Metacloud ( 2014-09-10 10:43:17 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

3 followers

Stats

Asked: 2014-09-10 08:01:31 -0500

Seen: 24,720 times

Last updated: Sep 10 '14