Linux command
az-sshkey 命令
网络
需要网络或远程资源。
常用示例
Create an SSH key resource
az sshkey create --name [MySSHKey] --resource-group [MyResourceGroup]
Create SSH key from existing public key
az sshkey create --name [MySSHKey] --resource-group [MyResourceGroup] --public-key @[~/.ssh/id_rsa.pub]
List all SSH key resources
az sshkey list --resource-group [MyResourceGroup]
Show SSH key details
az sshkey show --name [MySSHKey] --resource-group [MyResourceGroup]
Delete an SSH key resource
az sshkey delete --name [MySSHKey] --resource-group [MyResourceGroup]
说明
az sshkey manages Azure SSH public key resources, which allow storing SSH public keys in Azure for use when creating VMs. This simplifies VM deployment by referencing stored keys rather than providing them each time. When creating without --public-key, a new key pair is generated and the private key is saved locally.
参数
- --name -n
- Name of the SSH key resource.
- --resource-group -g
- Name of resource group.
- --public-key
- SSH public key content or path to a file containing the key.
FAQ
What is the az-sshkey command used for?
az sshkey manages Azure SSH public key resources, which allow storing SSH public keys in Azure for use when creating VMs. This simplifies VM deployment by referencing stored keys rather than providing them each time. When creating without --public-key, a new key pair is generated and the private key is saved locally.
How do I run a basic az-sshkey example?
Run `az sshkey create --name [MySSHKey] --resource-group [MyResourceGroup]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --name -n do in az-sshkey?
Name of the SSH key resource.