共用方式為


az sshkey

使用 vm 管理 ssh 公鑰。

命令

名稱 Description 類型 狀態
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"

必要參數

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

SSH 公鑰的名稱。

--resource-group -g

資源組名。 您可以使用 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.

--encryption-type

要產生的 SSH 金鑰加密類型。

屬性
預設值: RSA
接受的值: Ed25519, RSA
--location -l

Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。

--public-key

用來透過 ssh 向虛擬機驗證的 SSH 公鑰。 如果最初未在建立資源時提供這個屬性,則會在呼叫 generateKeyPair 時填入 publicKey 屬性。 如果在資源建立時提供公鑰,則提供的公鑰必須至少為 2048 位且 ssh-rsa 格式。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --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.

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name --ssh-public-key-name -n

SSH 公鑰的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
--yes -y

請勿提示確認。

屬性
預設值: False
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --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.

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --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.

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name --ssh-public-key-name -n

SSH 公鑰的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --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.

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name --ssh-public-key-name -n

SSH 公鑰的名稱。

屬性
Parameter group: Resource Id Arguments
--public-key

用來透過 ssh 向虛擬機驗證的 SSH 公鑰。 如果最初未在建立資源時提供這個屬性,則會在呼叫 generateKeyPair 時填入 publicKey 屬性。 如果在資源建立時提供公鑰,則提供的公鑰必須至少為 2048 位且 ssh-rsa 格式。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False