Friday, October 27, 2017
CloudStack reset password script
CloudStack reset password script
The process to install the password reset script described in the Cloudstacks admin guide was not working for me on an Ubuntu template so I tried to figure what was wrong with it.
In the admin guide they say that we should place the script in /etc/init.d/ and enable it using update-rc.d but that didnt work so I tried to place this in /etc/init/cloudstack.conf
##########################################################################That didnt not work either, so I took a look at the script and figured it needed to have the network configured to run.
description "CloudStack password reset"
author "Luis Davim"
# Be sure to block the display managers until our job has completed. This
# is to make sure our kernel services are running before user
# may launch.
start on runlevel [235] or starting gdm or starting kdm or starting prefdm
stop on runlevel [06]
pre-start exec /etc/init.d/cloud-set-guest-password
post-stop exec /etc/init.d/cloud-set-guest-password
So I configured my network interface like this:
Note: Ive also modified the password script to use chpasswd insted of passwd --stdin since ubuntu does not have the --stdin option in passwd and both ubuntu and centos have chpasswd but that was/is not the problem because usermod with mkpasswd was working...
just replaced:
# The primary network interfaceyou can also link the script into the /etc/network/if-up(down) folders:
auto eth0
iface eth0 inet dhcp
post-up /etc/init.d/cloud-set-guest-password
pre-down /etc/init.d/cloud-set-guest-password
ln -s /etc/init.d/cloud-set-guest-password/etc/network/if-up/cloud-set-guest-passwordAnd that was it, now I have an Ubuntu template with a working password reset script.
ln -s /etc/init.d/cloud-set-guest-password/etc/network/if-down/cloud-set-guest-password
Note: Ive also modified the password script to use chpasswd insted of passwd --stdin since ubuntu does not have the --stdin option in passwd and both ubuntu and centos have chpasswd but that was/is not the problem because usermod with mkpasswd was working...
just replaced:
echo $password | passwd --stdin $userwith
echo "$user:$password" | chpasswd
Labels:
cloudstack,
password,
reset,
script
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment