通过SSH连接到EC2在Mac OSX时权限错误 [英] Permissions error when connecting to EC2 via SSH on Mac OSx
问题描述
我是新来的EC2。我创造了我的安全凭证从该网站:
I am new to EC2. I created my security credentials from this site:
http://paulstamatiou.com/how-to-getting-开始与 - 亚马逊EC2
这伟大的工作,我重新启动,现在当我尝试连接,我得到一个登录/密码提示。 (我从来不成立。)经过多次尝试之后,我得到这个错误:
It worked great, I rebooted and now when I try to connect I get a login/password prompt. (Which I never set up.) After several attempts I get this error:
权限被拒绝(公钥,GSSAPI-与-MIC)。
Permission denied (publickey,gssapi-with-mic).
我是什么做错了吗?
推荐答案
两种可能性我能想到的,虽然他们都在你引用的链接中提到:
Two possibilities I can think of, although they are both mentioned in the link you referenced:
-
你不指定在你使用登录到服务器的SSH命令正确的SSH密钥对文件或用户名:
You're not specifying the correct SSH keypair file or user name in the ssh command you're using to log into the server:
SSH -i [完整路径密钥对文件]根@ [EC2实例的主机名或IP地址]
ssh -i [full path to keypair file] root@[EC2 instance hostname or IP address]
您没有对密钥对文件的正确权限;你应该使用
You don't have the correct permissions on the keypair file; you should use
搭配chmod 600密钥对文件]
chmod 600 [keypair file]
,以确保只有您可以读取或写入文件。
to ensure that only you can read or write the file.
请尝试使用-v选项和ssh来获得哪儿它的失败的详细信息,并回到这里后,如果you''d喜欢更多的帮助。
Try using the -v option with ssh to get more info on where exactly it's failing, and post back here if you''d like more help.
[更新]:好,那么这就是你的应该的看到,如果一切都设置正确:
[Update]: OK, so this is what you should have seen if everything was set up properly:
debug1: Authentications that can continue: publickey,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Trying private key: ec2-keypair
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
您运行从包含EC2-密钥对文件的目录ssh命令?如果是这样,请尝试指定-i ./ec2-keypair只是为了消除路径问题。同时检查ls -l命令[完整路径EC2-密钥对]文件,并确保该权限是600(显示为RW -------)。如果没有这样的作品,我怀疑该密钥对文件的内容,所以尽量用你的链接中的步骤重新创建它。
Are you running the ssh command from the directory containing the ec2-keypair file ? If so, try specifying -i ./ec2-keypair just to eliminate path problems. Also check "ls -l [full path to ec2-keypair]" file and make sure the permissions are 600 (displayed as rw-------). If none of that works, I'd suspect the contents of the keypair file, so try recreating it using the steps in your link.
这篇关于通过SSH连接到EC2在Mac OSX时权限错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!