Forum Discussion

danielcregg's avatar
danielcregg
Copper Contributor
Feb 18, 2022
Solved

Azure CLI create VM and assign it a password AND a ssh key for login?

How do I create a VM using Azure CLI and assign it a password AND a ssh key for login? Here is the command I want to use but it just creates the ssh key and ignores creating the password.    az vm...
  • Davy_A's avatar
    Feb 21, 2022
    Based on the info in the docs, it looks like you need to set the auth type to all to allow both SSH & password:
    --authentication-type
    Type of authentication to use with the VM. Defaults to password for Windows and SSH public key for Linux. "all" enables both ssh and password authentication.

    accepted values: all, password, ssh

Resources