Re-Inject keys into CloudStack System VMs

SSH Login failure after a CloudStack reinstall due to stale id_rsa keys.

[root@cloudplatform ~]# ssh -i /var/lib/cloud/management/.ssh/id_rsa -p 3922 10.102.100.132
Permission denied (publickey).

Fix:

[root@cloudplatform ~]# /usr/lib64/cloud/agent/scripts/vm/systemvm/injectkeys.sh 
Usage: injectkeys.sh  <new public key file> <new private key file> <systemvm iso path>
[root@cloudplatform ~]# bash -x /usr/lib64/cloud/agent/scripts/vm/systemvm/injectkeys.sh \
  /var/lib/cloud/management/.ssh/id_rsa.pub \
  /var/lib/cloud/management/.ssh/id_rsa \
  /mnt/ss/systemvm/systemvm-3.0.6.20121221114808.iso

Shanker Balan

Shanker Balan is a devops and infrastructure freelancer with over 14 years of industry experience in large scale Internet systems. He is available for both short term and long term projects on contract. Please use the Contact Form for any enquiry.

More Posts - Website

Follow Me:
TwitterLinkedIn