Generate password for Ubuntu user in Ubuntu Precise Cloud Image

Posted: May 29, 2015 in Uncategorized

When you boot standard Ubuntu Cloud image in the Openstack, no password or user is generated in the image by default. You can configure your Ubuntu Cloud image to set a static password or generate a password in the first boot of the image. You need to configure metadata service in the Openstack in order to use this.

Step 1:

Firstly, download your Ubuntu cloud image from this link: https://cloud-images.ubuntu.com/

Step 2:

Install guestfish in your server. This server probably will be your Glance image server. :

aptget install guestfish
Step 3:
In order to edit the image file open it with guestfish:
guestfish rw a preciseservercloudimgamd64disk1.img
root@ppm-dc-c3sv3-ju:~/sandbox# guestfish –rw -a precise-server-cloudimg-amd64-disk1.img
Step 4:
Now you will be taken to tje guestfish shell.
Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.

Type: ‘help’ for help on commands
‘man’ to read the manual
‘quit’ to quit the shell

Step 5:
><fs> run
Step 6:
><fs> list-filesystems
/dev/sda1: ext4
Step 7:
><fs> mount /dev/sda1 /
Step 8:
><fs> vi /etc/shadow
Blank the password for ubuntu user as follows
ubuntu::16548:0:99999:7:::
Step 9:
Now add this image to openstack glance and launch the instance.
Step 10:
You can log into the instance from the openstack horizon vnc console.
Once you log in as the ubuntu user, you can change the password with
the passwd command to one of your choice.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s