我无法 ssh 进入我的 EC2 实例,似乎是我传递给 ssh 的 ssh .pem 文件的权限级别存在问题,谷歌搜索这似乎是许多其他人遇到的问题,但他们的解决方案对我不起作用。
这是我尝试过的,请有人帮忙......
尝试 1:
asemani$ ssh -i ~/.ssh/secure.pem root@54.210.0.1
********************************************************************************
This is a private computer system containing information that is proprietary
and confidential to the owner of the system. Only individuals or entities
authorized by the owner of the system are allowed to access or use the system.
Any unauthorized access or use of the system or information is strictly
prohibited.
All violators will be prosecuted to the fullest extent permitted by law.
********************************************************************************
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '.ssh/secure.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key ".ssh/secure.pem": bad permissions
Permission denied (publickey).
尝试 2:
asemani$ chmod 600 ~/.ssh/secure.pem
asemani$ ls -l ~/.ssh/
total 56
-rw-r--r-- 1 asemani CORP\Domain Users 782 Apr 29 11:14 config
-rw-------@ 1 asemani CORP\Domain Users 1696 Apr 29 21:32 secure.pem
asemani$
asemani$ ssh -i .ssh/secure.pem root@54.210.0.1
********************************************************************************
This is a private computer system containing information that is proprietary
and confidential to the owner of the system. Only individuals or entities
authorized by the owner of the system are allowed to access or use the system.
Any unauthorized access or use of the system or information is strictly
prohibited.
All violators will be prosecuted to the fullest extent permitted by law.
********************************************************************************
Permission denied (publickey).
我不再收到警告,但权限仍然被拒绝。然后我还尝试对 .pem 文件执行 chmod 400
但这也不起作用。我不会将其粘贴在这里,因为这可能有点过分了。
这里发生了什么?如何通过 ssh 连接到我的 ec2?这应该是一件简单的事情??
将权限更改为chmod 400 ~/.ssh/secure.pem
我是一名优秀的程序员,十分优秀!