az vm user

Manage user accounts for a VM.

Commands

az vm user delete Delete a user account from a VM.
az vm user reset-ssh Reset the SSH configuration on a VM.
az vm user update Update or Add(only on Linux VM) users.

az vm user delete

Delete a user account from a VM.

az vm user delete --name
--resource-group
--username
[--no-wait]

Examples

Delete a user account.

az vm user delete -u username -n MyVm -g MyResourceGroup

Delete a user on all VMs in a resource group.

az az vm user delete -u username --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

Required Parameters

--name -n
The name of the Virtual Machine. You can configure the default using `az configure --defaults vm=<name>`.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
--username -u
The user name.

Optional Parameters

--no-wait
Do not wait for the long running operation to finish.

az vm user reset-ssh

Reset the SSH configuration on a VM.

az vm user reset-ssh --name
--resource-group
[--no-wait]

Examples

Reset the SSH configuration.

az vm user reset-ssh -n MyVm -g MyResourceGroup

Reset the SSH server on all VMs in a resource group.

az vm user reset-ssh --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

Required Parameters

--name -n
The name of the Virtual Machine. You can configure the default using `az configure --defaults vm=<name>`.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.

Optional Parameters

--no-wait
Do not wait for the long running operation to finish.

az vm user update

Update or Add(only on Linux VM) users.

az vm user update --name
--resource-group
--username
[--no-wait]
[--password]
[--ssh-key-value]

Examples

Update a Windows user account.

az vm user update -u username -p password -n MyVm -g MyResourceGroup

Update a Linux user account.

az vm user update -u username --ssh-key-value "$(< ~/.ssh/id_rsa.pub)"="" -n="" myvm="" -g="">

Update a user on all VMs in a resource group.

az vm user update -u username --ssh-key-value "$(< ~/.ssh/id_rsa.pub)"="" --ids="" $(az="" vm="" list="" -g="" myresourcegroup="" --query="" "[].id"="" -o="">

Required Parameters

--name -n
The name of the Virtual Machine. You can configure the default using `az configure --defaults vm=<name>`.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
--username -u
The user name.

Optional Parameters

--no-wait
Do not wait for the long running operation to finish.
--password -p
The user password.
--ssh-key-value
SSH public key file value or public key file path.