Skip to content

Latest commit

 

History

History
147 lines (111 loc) · 3.94 KB

Add-AzureRmVmssSshPublicKey.md

File metadata and controls

147 lines (111 loc) · 3.94 KB
external help file Module Name ms.assetid online version schema
Microsoft.Azure.Commands.Compute.dll-Help.xml
AzureRM.Compute
9C216103-EB77-468E-8684-F5E5400B73A7
2.0.0

Add-AzureRmVmssSshPublicKey

SYNOPSIS

Adds SSH public keys to the VMSS.

SYNTAX

Add-AzureRmVmssSshPublicKey [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet> [[-Path] <String>]
 [[-KeyData] <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The Add-AzureRmVmssSshPublicKey cmdlet adds the public keys that you can use to connect to the Virtual Machine Scale Set (VMSS) virtual machines over Secure Shell (SSH).

EXAMPLES

Example 1: Add an SSH public key to the VMSS

PS C:\> $VMSS = New-AzureRmVmssConfig
PS C:\> Add-AzureRmVmssSshPublicKey -VirtualMachineScaleSet $VMSS -KeyData "MIIDszCCApugAwIBAgIJALBV9YJCF/tAMA0GCSq12Ib3DQEB21QUAMEUxCzAJBgNV" -Path "/home/admin/.ssh/authorized_keys"

This example adds an SSH public key to the VMSS. The first command uses the New-AzureRmVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS. The second command adds an SSH key with the specified key data and stores the key at the specified path on the virtual machine.

PARAMETERS

-DefaultProfile

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

Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-KeyData

Specifies a SSH RSA public key data.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Path

Specifies the full path of a file, on the virtual machine, where this cmdlet stores the SSH public key. If the file already exists, this cmdlet appends the key to the file.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-VirtualMachineScaleSet

Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object.

Type: Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSet
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSet

System.String

OUTPUTS

Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSet

NOTES

RELATED LINKS

New-AzureRmVmssConfig