windows ssh远程登录阿里云遇到permissions are too open的错误

  • 时间:
  • 浏览:7

我试图用ssh -i 命令远程登录阿里云时,遇到如下错误:

:: Set Variable :: set key="C:CodeDKOMProlikeServicesapdis.pem" :: Remove Inheritance :: cmd /c icacls %key% /c /t /inheritance:d

:: Verify :: cmd /c icacls %key%

windows版本:

ssh版本:

本文来自云栖社区企业合作伙伴“汪子熙”,了解相关信息可不时要关注微信公众号"汪子熙"。

Permissions for 'private-key.ppk' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored.

在这人链接里找到了出理 方案:

[外链图片转存失败,源站将会有防盗链机制,建议将图片保存下来直接上传(img-jo0tK295-157630009916103)(https://user-images.githubusercontent.com/5669954/70841843-8543f43000-1e58-11ea-939d-b47af8300c565.png)]

:: Remove All Users, except for Owner :: cmd /c icacls %key% /c /t /remove Administrator "Authenticated Users" BUILTINAdministrators BUILTIN Everyone System Users

已经 使用脚本ssh -i sapdis.pem root@39.XX.XXX.142

登录成功:

:: Set Ownership to Owner :: cmd /c icacls %key% /c /t /grant %username%:F