New-AzSshKey

Create a SSH Public Key resource.

Note

This is the previous version of our documentation. Please consult the most recent version for up-to-date information.

Syntax

New-AzSshKey
   -ResourceGroupName <String>
   -Name <String>
   [-PublicKey <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Create a SSH Public Key resource.

Examples

Example 1

New-AzSshKey -ResourceGroupName "testRG" -Name "sshkey1" -PublicKey $publicKey

Creating a SSH Key resource with provided a public key.

Example 2

New-AzSshKey -ResourceGroupName "testRG" -Name "sshkey1"

Creating a SSH Key resource without providing a public key. A key pair will be generated and saved in ~.ssh. The public key will also be saved in the SSH Key resource.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of the Ssh Public Key resource to get.

Type:String
Aliases:sshkeyName
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:True
-PublicKey

Public Key value.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of a resource group.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:True

Inputs

String

Outputs

PSSshPublicKeyResource