windows ssh遠程登陸阿里雲遇到permissions are too open的錯誤

我試圖用ssh -i 命令遠程登陸阿里雲時,遇到以下錯誤:windows

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.ssh

clipboard1

ssh版本:ui

clipboard2

windows版本:阿里雲

clipboard3

在這個連接裏找到了解決方案:spa

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

clipboard4

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

clipboard5

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

clipboard6

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

clipboard7

以後使用腳本ssh -i sapdis.pem root@39.XX.XXX.142
登陸成功:it

clipboard8

要獲取更多Jerry的原創文章,請關注公衆號"汪子熙":
公衆號截圖

相關文章
相關標籤/搜索