New-AzureSSHKey
New-AzureSSHKey
Parameter Set: keypair New-AzureSSHKey [-KeyPair] [-Fingerprint] <String> [-Path] <String> [ <CommonParameters>] Parameter Set: publickey New-AzureSSHKey [-PublicKey] [-Fingerprint] <String> [-Path] <String> [ <CommonParameters>]
The New-AzureSSHKey cmdlet creates an SSH Key object for a certificate that has already been added to Windows Azure. This SSH Key object can then be used by the Add-AzureProvisioningConfig cmdlet when creating the configuration object for a new virtual machine using either the New-AzureVM or New-AzureQuickVM cmdlet. When included as part of a script to create a virtual machine creation, this cmdlet adds the specified SSH Public Key or Key Pair to the new virtual machine.
-Fingerprint<String>
Specifies the fingerprint of the certificate.
Aliases | none |
Required? | true |
Position? | 2 |
Default Value | none |
Accept Pipeline Input? | false |
Accept Wildcard Characters? | false |
-KeyPair
When specified, creates an object for inserting an SSH Key Pair into the new virtual machine configuration.
Aliases | none |
Required? | true |
Position? | 1 |
Default Value | none |
Accept Pipeline Input? | false |
Accept Wildcard Characters? | false |
-Path<String>
Specifies the path to store the SSH Public Key or Key Pair.
Aliases | none |
Required? | true |
Position? | 3 |
Default Value | none |
Accept Pipeline Input? | false |
Accept Wildcard Characters? | false |
-PublicKey
When specified, creates an object for inserting an SSH Public Key into the new virtual machine configuration.
Aliases | none |
Required? | true |
Position? | 1 |
Default Value | none |
Accept Pipeline Input? | false |
Accept Wildcard Characters? | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
-------------- Example 1 --------------
This command creates a certificate setting object for an existing certificate and then stores the object in a variable for later use.
C:\PS> $myLxCert = New-AzureSSHKey –Fingerprint "D7BECD4D63EBAF86023BB4F1A5FBF5C2C924902A" –Path "/home/username/.ssh/authorized_keys"
-------------- Example 2 --------------
This command adds a certificate to the Windows Azure service, and then creates a new Linux virtual machine that uses the certificate.
C:\PS> Add-AzureCertificate –ServiceName "MySvc" –CertToDeploy "C:\temp\MyLxCert.cer"C:\PS> $myLxCert = New-AzureSSHKey –Fingerprint "D7BECD4D63EBAF86023BB4F1A5FBF5C2C924902A" –Path "/home/username/.ssh/authorized_keys"C:\PC>New-AzureVMConfig -Name "MyVM2" -InstanceSize Small -ImageName $LxImage ` | Add-AzureProvisioningConfig -Linux -LinuxUser $lxUser -SSHPublicKeys $myLxCert -Password 'pass@word1' ` | New-AzureVM -ServiceName "MySvc"
Related topics