Random root password

Is there a mechanism for generating passwords for each VM and send to user e-mail after deploy?

Антон Зубков opennebula@discoursemail.com writes:

Is there a mechanism for generating passwords for each VM and send to user e-mail after deploy?

I think that deploying SSH public key is better, but I personally add
the attached context script for that purpose:

  • it runs before 12-ssh_host_key[1], as I use Debian systems, to detect
    the “first boot case”

  • you must have “pwgen” to generate the password

  • it expose the password on the VNC console for the user

Regards.

Footnotes:
[1] https://github.com/OpenNebula/addon-context-linux/blob/master/base_deb/etc/one-context.d/12-ssh_host_key

01-set-random-password (1.4 KB)

Thank you very much!