Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Add-AzureVMSshPublicKey

Add-AzureVMSshPublicKey

microsoft.azure.commands.compute.dll

Synopsis

Specifies the SSH public keys to use with the Virtual Machine.

Syntax

Add-AzureVMSshPublicKey [-VM] [-KeyData] [-Path] [-Profile] [-InformationAction] [-InformationVariable] [<CommonParameters>]

Detailed Description

Specifies the SSH public keys to use with the Virtual Machine.

Parameters

-VM <PSVirtualMachine>

VM object to modify. Create one using New-AzureVMConfig cmdlet or Get one using the Get-AzureVM cmdlet.

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

false

-KeyData <String>

Specifies a base-64 encoding of the public key used to SSH into the Virtual Machine.

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Path <String>

Specifies the full path of a file, on the Virtual Machine, where the SSH public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys

Aliases

None

Required?

false

Position

2

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Profile <AzureProfile>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationAction <ActionPreference>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationVariable <String>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- Example 1 --------------------------

$sshPath = "/home/testuser/.ssh/authorized_keys";
$sshPublicKey = "MIIDszCCApugAwIBAgIJALBV9YJCF/tAMA0GCSq12Ib3DQEB21QUAMEUxCzAJBgNV";
$vm = Add-AzureVMSshPublicKey -VM $vm -KeyData $sshPublicKey -Path $sshPath;
$vm = Add-AzureVMSshPublicKey -VM $vm -KeyData $sshPublicKey -Path $sshPath;