匯出 (0) 列印
全部展開
EN
本內容沒有您的語言版本,但有英文版本。

New-AzureSSHKey

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

New-AzureSSHKey

Creates a SSH Key object to insert an existing certificate into new Linux-based Windows Azure virtual machines.

 

Parameter Set: keypair
New-AzureSSHKey [-KeyPair] [-Fingerprint] <String> [-Path] <String> [ <CommonParameters>]

Parameter Set: publickey
New-AzureSSHKey [-PublicKey] [-Fingerprint] <String> [-Path] <String> [ <CommonParameters>]




 

This topic describes the cmdlet in the .6.19 version of the Windows Azure PowerShell module. To find out the version of the module you're using, from the Windows Azure PowerShell console, type (get-module azure).version.

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

顯示:
© 2014 Microsoft