az sshkey

Manage ssh public key with vm.

Commands

az sshkey create

Create a new SSH public key resource.

az sshkey delete

Delete an SSH public key.

az sshkey list

List all of the SSH public keys.

az sshkey show

Retrieve information about an SSH public key.

az sshkey update

Update an SSH public key resource.

az sshkey create

Create a new SSH public key resource.

az sshkey create --name
                 --resource-group
                 [--location]
                 [--public-key]
                 [--tags]

Examples

Create a new SSH public key resource.

az sshkey create --location "westus" --public-key "{ssh-rsa public key}" --resource-group "myResourceGroup" --name "mySshPublicKeyName"

Create a new SSH public key resource using public key in a file.

az sshkey create --location "westus" --public-key "@filename" --resource-group "myResourceGroup" --name "mySshPublicKeyName"

Create a new SSH public key resource with auto-generated value.

az sshkey create --location "westus" --resource-group "myResourceGroup" --name "mySshPublicKeyName"

Required Parameters

--name --ssh-public-key-name -n

The name of the SSH public key.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--public-key

SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

az sshkey delete

Delete an SSH public key.

az sshkey delete [--ids]
                 [--name]
                 [--resource-group]
                 [--subscription]
                 [--yes]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name --ssh-public-key-name -n

The name of the SSH public key.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

default value: False

az sshkey list

List all of the SSH public keys.

az sshkey list [--resource-group]

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az sshkey show

Retrieve information about an SSH public key.

az sshkey show [--ids]
               [--name]
               [--resource-group]
               [--subscription]

Examples

Get an ssh public key.

az sshkey show --resource-group "myResourceGroup" --name "mySshPublicKeyName"

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name --ssh-public-key-name -n

The name of the SSH public key.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sshkey update

Update an SSH public key resource.

az sshkey update [--ids]
                 [--name]
                 [--public-key]
                 [--resource-group]
                 [--subscription]
                 [--tags]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name --ssh-public-key-name -n

The name of the SSH public key.

--public-key

SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.