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]
                 [--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>.

--yes -y

Do not prompt for confirmation.

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]

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>.

az sshkey update

Update an SSH public key resource.

az sshkey update [--ids]
                 [--name]
                 [--public-key]
                 [--resource-group]
                 [--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>.

--tags

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