天天看點

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.

ssh版本:

windows版本:

在這個連結裡找到了解決方案:

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

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

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

[外鍊圖檔轉存失敗,源站可能有防盜鍊機制,建議将圖檔儲存下來直接上傳(img-jo0tK295-1576509916103)(

https://user-images.githubusercontent.com/5669954/70841843-8543f480-1e58-11ea-939d-b47af860c565.png)]

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

之後使用腳本ssh -i sapdis.pem [email protected]

登入成功:

本文來自雲栖社群合作夥伴“汪子熙”,了解相關資訊可以關注微信公衆号"汪子熙"。

繼續閱讀