我创build了两个ec2实例,并能够ssh进入前两个罚款。 创build第三个后,我试图ssh到任何一个这个错误。
这就是我正在运行: ssh -v -i /Users/name/meteor.pem [email protected].###
要得到:
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: /etc/ssh_config line 102: Applying options for * debug1: Connecting to 52.25.###.## [52.25.###.##] port 22. debug1: Connection established. debug1: identity file /Users/name/.ssh/meteor.pem type -1 debug1: identity file /Users/name/.ssh/meteor.pem-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.2 debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH* debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr [email protected] none debug1: kex: client->server aes128-ctr [email protected] none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<##92) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: RSA 3f:5a:e4:15:3e:c6:ee:f4:6e:97:59:02:ee:df:e2:a5 debug1: Host '52.25.###.##' is known and matches the RSA host key. debug1: Found key in /Users/name/.ssh/known_hosts:13 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/name/.ssh/github_rsa debug1: Authentications that can continue: publickey debug1: Trying private key: /Users/name/.ssh/meteor.pem debug1: read PEM private key done: type RSA debug1: Authentications that can continue: publickey debug1: No more authentication methods to try. Permission denied (publickey).
我试过这个post的build议:
sudo chmod 700 ~/.ssh/ sudo chmod 600 ~/.ssh/* sudo chown -R User ~/.ssh/ sudo chgrp -R User ~/.ssh/
但行chgrp -R User ~/.ssh/给我错误chgrp: mycomputerusername: illegal group name
我无法弄清楚组名应该是什么。 我的aws帐户用户名?
我也不知道我做了什么导致这个错误。 每次我创build一个新的chmod 600 meteor.pem我运行chmod 600 meteor.pem ,所以也许我input这行错了,这是造成权限问题?
任何有关下一步尝试的build议将不胜感激!
由于您在.ssh中使用700作为目录权限,600使用文件权限,所以不需要更改组。
从上面的日志中可以meteor.pem使用meteor.pem ,创build第三个EC2实例时是否使用了不同的密钥?
您可以使用aws-cli与ec2-fingerprint-key .ssh / key.pem(您的私钥/密钥名称的path)比较您的私钥指纹并与您的实例公共指纹