Last active
January 26, 2024 03:09
-
-
Save agolomoodysaada/1ad50f3ca4efd32d543dd9b66da12eff to your computer and use it in GitHub Desktop.
Azure Virtual Machine Scale Set(VMSS) Reset SSH KEY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az vmss extension set \ | |
--vmss-name <vmss-name> \ | |
-g <resource-group> \ | |
-n VMAccessForLinux \ | |
--publisher Microsoft.OSTCExtensions \ | |
--version 1.4 \ | |
--protected-settings "{\"username\":\"deploy_user\", \"ssh_key\":\"$(cat ~/.ssh/id_rsa.pub)\"}" | |
# Upgrade ALL instances in the scale set with the new key | |
az vmss update-instances --instance-ids '*' | |
-n <vmss-name> | |
-g <resource-group> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't work! everytime I try this give me an error /home/user/.ssh/id_rsa.pub: No such file or directory