← Back to team overview

cloud-init team mailing list archive

Re: Qustion about using cloud-init to set root password for the deployed vm.

 

Hi Scott,
Thanks for your quick response, according to our requirement , we need the
root password can be a random value
when deploying instead of a fixed value that same as the one when capture
the image. This will require cloud-init
to change the root password at the first time when it is boot up .
We have one ugly solution that put the change root password script to
user-data and then cloud-init can execute the
script  when boot up and then change the root password.
It depend on you to provide the patch if it is possible . Thank you.



Best Regards!
Na Fei Yang  (杨娜菲)

z/VM Development, CSTL
Intranet ID: nafeiy@xxxxxxxxxx
Notes ID:Na Fei NF Yang/China/IBM
Ext : 010-82454803
Address: 3/F,3BW388 Ring Building, ZhongGuanCun Software Park, Haidian
District, Beijing 100193, PRC



From:	Scott Moser <scott.moser@xxxxxxxxxxxxx>
To:	Na Fei NF Yang/China/IBM@IBMCN,
Cc:	Steven Gessner <gessners@xxxxxxxxxx>, Jian NW
            Wang/China/IBM@IBMCN
Date:	07/10/2013 08:22 PM
Subject:	Re: Qustion about using cloud-init to set root password for the
            deployed vm.



On Wed, 10 Jul 2013, Na Fei NF Yang wrote:

>
> Hi Scott,
> Thanks for your help about my questions yesterday, I meet another problem
> about set root password hopefully I can get some advise from you. Thanks
in
> advance.

I'd suggest not using root password.  If you're logging in interactively,
just log in as a normal user that is provisioned (ie, in ubuntu cloud
images, its "ubuntu").  Then use sudo.  If you're doing so
non-interactively, use ssh and sudo from there.

I'd probably accept patches to that allowed the setting of root password,
but there really isn't much use for it.

In the future, could you please send mails like this to the cloud-init
mailing list ?  join https://launchpad.net/~cloud-init


Scott
> As you know, we use config drvie the datasource for cloud-init. In the
> meta_data.json file , I pass the admin_pass as an key to it. It seems
that
> cloud-init-local doesn't read this value and set the os root password to
be
> the one in meta_data.json.   Need I make some additional configuration to
> cloud-init to let it work ?    Do you have any suggestions?
>
> Here is my config drive content.
> 2012-08-10  2013-04-04  content  latest
> [root@gpok165 openstack]# cd latest/
> [root@gpok165 latest]# ls
> meta_data.json  user_data
> [root@gpok165 latest]# cat meta_data.json
> {"files": [{"path": "/etc/sysconfig/network-scripts/ifcfg-eth0",
> "content_path": "/content/0000"}], "admin_pass": "AXKJ36eQpo6q",
> "random_seed": "c7ZrrtrKoA9OXucjhAgUpm9BNM4aKFs8cTvEmEsQRyhJF1Z+evAr1NM
> +S6Ld9jFRTFjNjwxiX8Ix3z9ap5VXhOq7iW1m3pJqJstYQ9OtA80ze30gK369
> +uWD9YTpFotcWJsJZ1BvdunDvqzmocPGFlk0DJ
> +QzYJ099hF9m/b2X11PX6YBM4ZPAlAfD4Zuq3j9HlmhK2yfHJSK4bMhRp2j/u
> +nycjjCWD2aFG6q5YTasY9IikHghQ5092glX5KeFnVC3QytPI5f+ZHftMplr2Aiv1GvAN4i2
>
+HBxBtspoeD9FbpqyDrCW8NUgUyMm4l2vEVzvSEIqoFRAs3uVgka7tPZCnU7XgRi3I0fQAaLmoxlgsNaVr8aGFTex

> +gtP65m/lnAm
>
+X5bSwAZJdxK6BV7AQoG3nWTEmTpeiUbHR97R40S4CXjl4Df93iXjCtqYONU4zedhjGJ0iLpX93Js4NHCZTxobvcNb3q6l45feHVcTb1WZgl9r

> +ekvAIXg27MX2t5KySqvTFEZxL8PvJsstA13aEiJBZgWtEZvb27X/UNOfm+YQWOchDh
>
+uH7nRBz8QzZvpM6/P7YsGTJyv3CE7J1jEEcO0vQeYcWjSUFPAjrCK15DgAp2DMDj/YhpZ15VkhDTmzR

> +NvBeoy1UZdkRq3JEZ39z8fKQofD+r7muqNZ5g=", "uuid":
> "c2ade28b-658c-4e79-8ed4-43a5ee7ea0f4", "availability_zone": "None",
> "hostname": "tst1.novalocal", "launch_index": 0, "meta": {"dsmode":
> "local"}, "name": "tst1"}[root@gpok165 latest]#
>
>
>
> Best Regards!
> Na Fei Yang  (杨娜菲)
>
> z/VM Development, CSTL
> Intranet ID: nafeiy@xxxxxxxxxx
> Notes ID:Na Fei NF Yang/China/IBM
> Ext : 010-82454803
> Address: 3/F,3BW388 Ring Building, ZhongGuanCun Software Park, Haidian
> District, Beijing 100193, PRC

GIF image


Follow ups