Switch to public key auth for VMs

This commit is contained in:
Pavel Khakhulin 2017-06-06 18:07:16 +03:00
parent d278a5a114
commit 109822884a
1 changed files with 15 additions and 4 deletions

View File

@ -8,10 +8,10 @@
"description": "User name for the Virtual Machine."
}
},
"adminPassword": {
"type": "securestring",
"sshPublicKey": {
"type": "string",
"metadata": {
"description": "Password for the Virtual Machine."
"description": "Public key to access the Virtual Machine."
}
},
"dnsLabelPrefix": {
@ -126,7 +126,18 @@
"osProfile": {
"computerName": "[variables('vmName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
"adminPassword": "",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"path": "[concat('/home/', variables('adminUsername'), '/.ssh/authorized_keys')]",
"keyData": "[variables('sshPublicKey')]"
}
]
}
},
},
"storageProfile": {
"imageReference": {