【发布时间】:2015-06-20 02:28:40
【问题描述】:
我是 Amazon AWS 的新手,我正在尝试连接到我的实例,以便上传我的文件并设置我的数据库。
最初在连接时,控制台返回一个错误,指出我的密钥权限不正确,在更正此问题后,控制台返回一个权限被拒绝错误。
imrans-macbook:WORK imran$ ssh -i MYKEY.pem ec2-user@ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com
The authenticity of host 'ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com (xx.xxx.xxx.xxx)' can't be established.
RSA key fingerprint is xx:xxx:xx:xxx:xxx:xxx:xxx.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': Yes
Warning: Permanently added 'ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com,xx.xxx.xxx.xxx' (RSA) to the list of known hosts.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'MYKEY.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: MYKEY.pem
Permission denied (publickey).
imrans-macbook:WORK imran$ chmod 400 MYKEY.pem
imrans-macbook:WORK imran$ ssh -i MYKEY.pem ec2-user@ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com
Permission denied (publickey).
【问题讨论】:
-
你的 chmod 没问题,是服务器拒绝你的密钥。
标签: amazon-web-services ssh terminal