我试图用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的原创文章,请关注公众号"汪子熙":