【发布时间】:2021-11-25 03:06:57
【问题描述】:
如何在 Azure 中创建从 Windows10 VM 到 RHEL8 VM 的 PowerShell 会话而不将 SSH 密钥存储在磁盘上? 看起来New-PSSession cmdlet 不接受 SSH 密钥作为字符串。
$pssession = New-PSSession -Name RHELSession -HostName <> -Port 22 -Subsystem powershell -UserName <> -KeyFilePath .\<>.pem -SSHTransport
Invoke-Command -Session $pssession -ScriptBlock {hostname}
一个Get-AzSshKey 或Get-AzKeyVaultSecret 可以在不将.pem 文件存储在磁盘上的情况下从内存中提供密钥吗?
(Get-AzSshKey -ResourceGroupName <> -Name <>).publicKey
【问题讨论】:
-
SSH.NET 程序集支持从内存中加载密钥。
标签: powershell windows-10 azure-keyvault ssh-keys