az sshkey
使用 vm 管理 ssh 公钥。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az sshkey create |
创建新的 SSH 公钥资源。 |
Core | GA |
az sshkey delete |
删除 SSH 公钥。 |
Core | GA |
az sshkey list |
列出所有 SSH 公钥。 |
Core | GA |
az sshkey show |
检索有关 SSH 公钥的信息。 |
Core | GA |
az sshkey update |
更新 SSH 公钥资源。 |
Core | GA |
az sshkey create
创建新的 SSH 公钥资源。
az sshkey create --name --ssh-public-key-name
--resource-group
[--encryption-type {Ed25519, RSA}]
[--location]
[--public-key]
[--tags]
示例
创建新的 SSH 公钥资源。
az sshkey create --location "westus" --public-key "{ssh-rsa public key}" --resource-group "myResourceGroup" --name "mySshPublicKeyName"
使用文件中的公钥创建新的 SSH 公钥资源。
az sshkey create --location "westus" --public-key "@filename" --resource-group "myResourceGroup" --name "mySshPublicKeyName"
使用自动生成的值创建新的 SSH 公钥资源。
az sshkey create --location "westus" --resource-group "myResourceGroup" --name "mySshPublicKeyName"
使用 Ed25519 加密创建新的 SSH 公钥资源。
az sshkey create --location "westus" --resource-group "myResourceGroup" --name "mySshPublicKeyName" --encryption-type "Ed25519"
必需参数
SSH 公钥的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
要生成的 SSH 密钥的加密类型。
属性 | 值 |
---|---|
默认值: | RSA |
接受的值: | Ed25519, RSA |
Location.
az account list-locations
中的值。 可以使用 az configure --defaults location=<location>
配置默认位置。
用于通过 ssh 向虚拟机进行身份验证的 SSH 公钥。 如果在创建资源时最初未提供此属性,则会在调用 generateKeyPair 时填充 publicKey 属性。 如果在创建资源时提供了公钥,则提供的公钥必须至少为 2048 位且采用 ssh-rsa 格式。
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az sshkey delete
删除 SSH 公钥。
az sshkey delete [--ids]
[--name --ssh-public-key-name]
[--resource-group]
[--subscription]
[--yes]
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
SSH 公钥的名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az sshkey list
列出所有 SSH 公钥。
az sshkey list [--resource-group]
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az sshkey show
检索有关 SSH 公钥的信息。
az sshkey show [--ids]
[--name --ssh-public-key-name]
[--resource-group]
[--subscription]
示例
获取 ssh 公钥。
az sshkey show --resource-group "myResourceGroup" --name "mySshPublicKeyName"
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
SSH 公钥的名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az sshkey update
更新 SSH 公钥资源。
az sshkey update [--ids]
[--name --ssh-public-key-name]
[--public-key]
[--resource-group]
[--subscription]
[--tags]
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
SSH 公钥的名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
用于通过 ssh 向虚拟机进行身份验证的 SSH 公钥。 如果在创建资源时最初未提供此属性,则会在调用 generateKeyPair 时填充 publicKey 属性。 如果在创建资源时提供了公钥,则提供的公钥必须至少为 2048 位且采用 ssh-rsa 格式。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |