我想SSH入我的EC2实例,并获得以下ssh详细输出。 身份文件是pem格式,我认为是X.509。 我不知道login名,或者我可以用-l标志尝试。 在此之前,我只收到一个文件权限错误,因为文件具有不正确的权限,我更改为600,并将包含密钥的目录设置为700.密钥不在〜/ .ssh文件夹中,但在~aws-kes/aws-keys.pem
我运行这个命令:
$ ssh -v -i aws-keys/aws-keys.pem ec2...ompute.amazonaws.com
我得到以下输出:
OpenSSH_5.3p1 Debian-3ubuntu4, OpenSSL 0.9.8k 25 Mar 2009 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to ec2...ompute.amazonaws.com [0.0.0.0] port 22. debug1: Connection established. debug1: identity file aws-keys/aws-keys.pem type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3 debug1: match: OpenSSH_5.3 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu4 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...ompute.amazonaws.com' is known and matches the RSA host key. debug1: Found key in /home/wissen16/.ssh/known_hosts:10 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: Offering public key: wissen16@wissen16 debug1: Authentications that can continue: publickey debug1: Trying private key: aws-keys/aws-keys.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).
编辑:我读了几个可能类似的问题,他们没有帮我:(
那么你需要提供用户名(login)和身份validation成功的私钥。
否则,它会尝试将您的当前(本地)用户名login。 所以,如果你不知道哪个用户名与你的密钥一起使用,你将无法使用SSHlogin。
我从社区AMI创build了一个新的Ubuntu实例。 我能够使用相同的命令ssh进入实例。 感谢所有帮助。
#ssh -v -i id_YWDRajat [email protected]
上面的ref工作正常:)