CentOS SSH到AWS EC2实例崩溃/冻结

时间:2014-05-08 12:33:33

标签: linux amazon-web-services ssh amazon-ec2

我正在尝试连接到运行Amazon AMI的AWS EC2实例。

我已下载安全组密钥对并设置了正确的权限。

chmod 400 ~/Downloads/keyPairFile.pem

然后我尝试通过公共DNS地址连接到ssh。

ssh -v -i ~/Downloads/keyPairFile.pem ec2-user@ec2-ip.region.compute.amazonaws.com

我得到以下详细输出。

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to ec2-ip.region.compute.amazonaws.com [ip] port 22.
debug1: Connection established.
debug1: identity file ~/Downloads/keyPairFile.pem type -1
debug1: identity file ~/Downloads/keyPairFile.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) 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: Host 'ec2-ip.region.compute.amazonaws.com' is known and matches the RSA host key.
debug1: Found key in ~/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: ~/Downloads/keyPairFile.pem
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env XMODIFIERS = @im=none
debug1: Sending env LANG = en_US.UTF-8

此时终端每次都会挂起。 甚至没有^ C逃脱工作。

有人可以帮忙吗?

编辑:更新。 我只是尝试使用AWS在其控制台中提供的Java Client SSH连接到该实例。在尝试连接时,这似乎也会挂起。我得到以下输出。

MindTerm home: ~/.mindterm/
SSH Server/Alias: [ip here]
Connected to server running SSH-2.0-OpenSSH_6.2

Server's hostkey (ssh-dss) fingerprint:
openssh md5:  [openssh hash here]
bubblebabble: [bubblebabble here]

但是,我的Windows 7桌面上的Java客户端功能完备。

1 个答案:

答案 0 :(得分:0)

这似乎发生在webapp无法找到您的pem文件时。检查您的文件路径和语法,以100%确定一切正确。在我的Mac上,答案涉及使用正斜杠而不是反斜杠(如示例所示)。结束使用:

/Users/david/Desktop/keypair.pem