[pve-devel] Set Password for LCX Container with API create

Detlef Bracker bracker at 1awww.com
Sat Feb 4 04:15:25 CET 2017


I close this thread, why this is not the problem of the API, but a
problem of wrong templates!
I open a new thread!


Am 04.02.2017 um 01:48 schrieb Detlef Bracker:
> sorry, but the PHP-API let send the password, but the password will not
> been set in the virtual machine!
>
> Now via PHP-API:
>
> Var new_container_settings:
> Array
> (
>     [ostemplate] => local:vztmpl/debian-8.0-standard_8.6-1_amd64.tar.gz
>     [vmid] => 494
>     [hostname] => TE494.ourhost.tld
>     [storage] => local
>     [pool] => normal
>     [onboot] => 1
>     [description] => backup:0
>     [cpulimit] => 1
>     [rootfs] => 14
>     [memory] => 256
>     [swap] => 256
>     [password] => sEF87FYGh4v
>     [net0] =>
> name=eth0,bridge=vmbr2,firewall=1,gw=123.123.123.123,ip=234.234.234.234/27,rate=950
> )
>  
>
> HTTP/1.1 200 OK
> Cache-Control: max-age=0
> Connection: Keep-Alive
> Date: Fri, 03 Feb 2017 23:29:51 GMT
> Pragma: no-cache
> Server: pve-api-daemon/3.0
> Content-Length: 209
> Content-Type: application/json;charset=UTF-8
> Expires: Fri, 03 Feb 2017 23:29:51 GMT
>
> {"data":[{"mem":120043079680,"maxmem":133702338560,"maxdisk":2050680012812,"type":"node","cpu":0.0186248220269681,"node":"myhost","maxcpu":64,"uptime":1035289,"disk":227239936055,"id":"node/myhost","level":"c"}]}
>
> The risc about SSH with password, I know! When we have enough time, we
> will programm a dialog for our
> customers and a key procedure, to set the autenthication direct via
> SSH-key! Yes but now we have not this time!
>
> In the documentation of http://pve.proxmox.com/wiki/Proxmox_VE_API their
> are not enough informations,
> about send the passwords! In the top need a warning "Create
> LXC-Container with passwords can used only on this way ..... "
>
> Now I am hanging 4 days about this part and a better documentation will
> reduce the problem sure to only one hour!
> A nice example will help thousends of proxmox administrators!
>
>
>
>
> Am 30.01.2017 um 15:59 schrieb Fabian Grünbichler:
>>> Detlef Bracker <bracker at 1awww.com> hat am 30. Januar 2017 um 14:39 geschrieben:
>>> Dear Marco,
>>>
>>> thats not possible! In the man page is written, that is so possible, but
>>> the value cant been send with pct create!
>> Not true, the man page says that you can pass "-password" to set the root password[1], not that the "password" parameter takes a string value and sets that value as password.
>>
>>> Thats give same as in the api an error "to much parameters"!
>> I guess you mean via pvesh, and not via the API? pvesh has its own internal password handling, like pct has. This is intentional, because you don't want passwords to visible in the process list and/or history.
>>
>>> When you send only "pct create -password" then the shell ask for the
>>> password! But this is not handable for batches!
>> If you want to batch create containers, you can do so via the API (the actual one that you can use over HTTPS). Like the api-viewer[2] says, the API path "POST /api2/json/nodes/{node}/lxc" has an optional string parameter that allows directly setting the password.
>>
>> Please also note that neither the API nor the "pct create" command require setting a password, you can also pass one or more public SSH keys (which are of course by nature not as sensitive as plain text passwords, and thus do not have the same constraints), or even nothing at all (in which case, you need to use "pct exec" or "pct enter" to run stuff in the container).
>>
>> Hope this clears things up.
>>
>> 1: http://pve.proxmox.com/pve-docs/pct.1.html
>> 2: http://pve.proxmox.com/pve-docs/api-viewer/index.html
>>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

-- 

ACHTUNG: Ihr Anfragetext befindet sich unter unserem Absender!
P.S. ePrivacy in Europa - lesen Sie mehr - read more
<http://blog.1awww.com/2012/05/30/achtung-internet-seiten-betreiber-eprivacy-richtlinien-umzusetzen/>


Mit freundlichen Gruessen
1awww.com - Internet-Service-Provider

Detlef Bracker
Camino Velilla 1, E 18690 Almunecar, Tel.: +34.6 343 232 61 * EU-VAT-ID:
ESX4516542D

This email and any files transmitted are confidential and intended only
or the person(s) directly addressed. If you are not the intended
recipient, any use, copying, transmission, distribution, or other forms
of dissemination is strictly prohibited. If you have received this email
in error, please notify the sender immediately and permanently delete
this email with any files that may be attached.

Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a
su destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Detlef
Bracker. En caso de no ser usted la persona a la que fuera dirigido este
mensaje y a pesar de ello está continúa leyéndolo, ponemos en su
conocimiento que está cometiendo un acto ilícito en virtud de la
legislación vigente en la actualidad, por lo que deberá dejarlo de leer
automáticamente.

Detlef Bracker no es responsable de su integridad, exactitud, o de lo
que acontezca cuando el correo electrónico circula por las
infraestructuras de comunicaciones electrónicas públicas. En el caso de
haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente.

El correo electrónico vía Internet no permite asegurar la
confidencialidad de los mensajes que se transmiten ni su integridad o
correcta recepción, por lo que Detlef Bracker no asume ninguna
responsabilidad que pueda derivarse de este hecho.

No imprima este correo si no es necesario. Ahorrar papel protege el
medio ambiente.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20170204/cee7a7a6/attachment.sig>


More information about the pve-devel mailing list