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

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

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.

clipboard1

ssh版本:

clipboard2

windows版本:

clipboard3

在这个链接里找到了解决方案:

:: Set Variable :: set key="C:\Code\DKOM\ProlikeService\sapdis.pem" :: Remove Inheritance :: cmd /c icacls %key% /c /t /inheritance:d

clipboard4

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

clipboard5

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

clipboard6

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

clipboard7

之后使用脚本ssh -i sapdis.pem [email protected]
登录成功:

clipboard8

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
公众号截图

猜你喜欢

转载自www.cnblogs.com/sap-jerry/p/12054568.html