我試圖用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
ssh版本:ui
windows版本:阿里雲
在這個連接裏找到了解決方案:spa
:: Set Variable :: set key="C:CodeDKOMProlikeServicesapdis.pem" :: Remove Inheritance :: cmd /c icacls %key% /c /t /inheritance:dblog
:: Set Ownership to Owner :: cmd /c icacls %key% /c /t /grant %username%:Fip
:: Remove All Users, except for Owner :: cmd /c icacls %key% /c /t /remove Administrator "Authenticated Users" BUILTINAdministrators BUILTIN Everyone System Usersrem
:: Verify :: cmd /c icacls %key%cmd
以後使用腳本ssh -i sapdis.pem root@39.XX.XXX.142
登陸成功:it
要獲取更多Jerry的原創文章,請關注公衆號"汪子熙":