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 root@39.XX.XXX.142
登錄成功:

clipboard8

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM