[one-users] Opennebula template Push root password.
Jaime Melis
jmelis at opennebula.org
Wed Apr 2 06:16:29 PDT 2014
You should decode the ROOT_PASSWORD inside that script, something in the
lines of:
#!/bin/bash
PASS=$(echo "$ROOT_PASSWORD" | base64 -d)
usermod -p "$PASS" root
On Wed, Apr 2, 2014 at 3:13 PM, Leszek Master <keksior at gmail.com> wrote:
> I'm trying to do this on ubuntu, i did what you said i've created file
> names init.sh upload it to Files and named there init.sh too. Next i
> applied it to template ($FILE[IMAGE_ID=10]) added ROOT_PASSWORD base 64
> encoded and it doesn't work :(
>
> My init.sh:
>
> #!/bin/bash
> usermod -p "$ROOT_PASSWORD" root
>
> But it didn't work.
>
>
> 2014-04-02 11:37 GMT+02:00 Jaime Melis <jmelis at opennebula.org>:
>
>> Leszek,
>>
>> Create a script, call it "init.sh", upload it to the Files & Kernel tab
>> (as a Context type). Select it under the Context -> Files section of the VM
>> Template.
>>
>> Whatever you put inside that init.sh script will get executed.
>>
>> The contents of the script depend on the distro you are using, but if
>> you're using CentOS 6, for instance, you might want to write something like
>> this:
>>
>> > #!/bin/bash
>> > echo "root:$ROOT_PASSWORD" | passwd
>>
>> And then you can specify the custom variable ROOT_PASSWORD in the VM
>> Template.
>>
>> Please note that it's recommended to use base64 encoding for this type
>> of things, since otherwise it might lead to character problems.
>>
>>
>>
>>
>>
>> On Wed, Apr 2, 2014 at 11:09 AM, Leszek Master <keksior at gmail.com> wrote:
>>
>>> How can i push root password to a VM for example using context?
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opennebula.org
>>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>>
>>>
>>
>>
>> --
>> Jaime Melis
>> Project Engineer
>> OpenNebula - Flexible Enterprise Cloud Made Simple
>> www.OpenNebula.org | jmelis at opennebula.org
>>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>
--
Jaime Melis
Project Engineer
OpenNebula - Flexible Enterprise Cloud Made Simple
www.OpenNebula.org | jmelis at opennebula.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20140402/a5a08ef0/attachment-0002.htm>
More information about the Users
mailing list