dimsijul commented on pull request #4070: URL: https://github.com/apache/cloudstack/pull/4070#issuecomment-655723061
> How do I set this up? the doc instructions dont seem to work. > I am running a centos 7 VM > downloaded cloud-set-guest-password.in and renamed it cloud-set-guest-password > moved it to /etc/init.d/ > chmod +x /etc/init.d/cloud-set-guest-password > reset the password. > > when the vm boots up, I am able to log in with the old password. > > it works on windows. > > what am I doing wrong? > > CS: 4.14. Hi @gaaray2k, you are right, one step is missing. In order to make the script work (wether it is Ubuntu, Debian or CentOS) you have to add a systemd service that will launch the password script at boot time. What we do to make this work is to create the file /etc/systemd/system/setpassword.service and set it to mode +x with the following content : [Unit] Description=script to reset the root password Wants=network-online.target After=network-online.target [Service] Type=oneshot ExecStart=/bin/bash /etc/init.d/cloud-set-guest-password.sh [Install] WantedBy=default.target This procedure should allow the system to run the cloud-set-guest-password script at boot time and as soon as the network is detected and therefore, if a password change is pending on the DHCP of the VM, it should be reset. Don't forget that this feature only works if the VM's network is set to DHCP. Let me know if it's ok or if you need further assistance. Cheers, Julien ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
