[英]Error Public Key when trying to ssh into Google Cloud Platform VM
[英]Azure VM creation using ssh public key source=use existing public key
我使用“使用现有公钥”创建了一个 VM。 当我尝试使用 SSH 登录 Linux 服务器时,出现“权限被拒绝(公钥)”错误。 如果我 select“使用存储在 Azure 中的现有密钥”,它会按预期工作。
你能建议我为什么会收到这个错误吗?
问候,桑托什
您不能将 Azure 中创建的public key
用作Use Existing Public Key
。 Public Key
在 Azure 中创建,仅供User existing key stored in Azure
。
要使用Use Existing Public Key
,您需要在本地计算机中创建一个公钥,或者您也可以使用 azureCLI 创建。
以下命令使用 RSA 加密创建一个 SSH 密钥对,位长为 4096:
ssh-keygen -m PEM -t rsa -b 4096
使用上面的命令,您将拥有两个密钥,一个是private
密钥 (id_rsa),另一个是public
密钥 (id_rsa.pub)。使用公共密钥,您可以在此位置获取密钥cd /home/rahul/.ssh/
请参阅此Microsoft 文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.